The extension API includes a rich collection of macros that allows you to
return values from your functions. These macros come in two main flavors.
The first is of the form RETVAL_type(), which sets the return value but your C
code keeps on executing. This is usually used if you still want to do some clean-
ing up before returning control over to the scripting engine. You will then need
to use the C return statement “return;” to return to PHP. The latter, which are
the more popular macros, are of the form RETURN_type(), which set the return
type and return control back to PHP. Table 15.2 explains most of the existing
macros. (more…)
