Home  >  Article  >  Backend Development  >  Macro for php expansion return value in zend engine

Macro for php expansion return value in zend engine

WBOY
WBOYOriginal
2016-07-29 09:07:211837browse

ZEND_API provides parameter return method

Set the return value and end the functionSet the return valueMacro 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_TRUERETVAL_TRUEReturns boolean true. Notice that this macro has no parentheses.
RETURN_FALSERETVAL_FALSEReturns 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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn