To return data from a function you may use the convenience macros provided by the Zend API or assign to the predefined return_value zval pointer.

If you do not add a <code> section to your function the generated code skeleton will include a suggestion on how to return data. If you put your own code into the XML specification you also have to take care of returning your results yourself.

RETURN_BOOL(1); // returning a PHP bool
RETURN_TRUE;    // short for RETURN_BOOL(1)
RETURN_FALSE;    // short for RETURN_BOOL(0)

RETURN_LONG(42); // returning a PHP int

RETURN_DOUBLE(3.14); // returning a PHP float

RETURN_STRING(stringvar, 1); // returning copy of a C string
RETURN_STRING(stringvar, 0); // returning a C string allocated with emalloc()

RETURN_STRINGL(strvar, len, 1); // binary safe return of string copy
RETURN_STRINGL(strvar, len, 0); // binary safe return of emalloc()ed string