ZEND_API provides parameter return method
Set the return value and end the function | Set the return value | Macro return type and parameters |
RETURN_LONG(l) | RETVAL_LONG(l) | Integer |
RETURN_BOOL(b) | RETVAL_BOOL(b) | Boolean number (1 or 0) |
RETURN_NULL() | RETVAL_NULL() | NULL |
RETURN_DOUBLE(d) | RETVAL_DOUBLE(d) | Floating point number |
RETURN_STRING(s, dup) | RETVAL_STRING(s, dup) | String. If dup is 1, the engine will call estrdup() to repeat s, using copy. If dup is 0, use s |
RETURN_STRINGL(s, l, dup) | RETVAL_STRINGL(s, l, dup) | a string value of length l. Same as the previous macro, but faster because the length of s is specified. |
RETURN_TRUE | RETVAL_TRUE | Returns boolean true. Notice that this macro has no parentheses. |
RETURN_FALSE | RETVAL_FALSE | Returns boolean false. Notice that this macro has no parentheses. |
RETURN_RESOURCE(r) | RETVAL_RESOURCE(r) | Resource handle. |
The above introduces the macro of the PHP expansion return value in the zend engine, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.