This is an alias for -1
| type | parameter | description |
|---|---|---|
| zend_class_entry | class_container | The container in which to store this class type |
| char* | class_name | The name of the class as seen in userspace |
| zend_function_entry[] | functions | Array of methods |
You should use this macro to set class entry properties when you do not need to specify methods for equivalents to __get(), __set(), __call(), __isset(), or __unset().
This is an alias for INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
Example:
zend_class_entry ce;
INIT_CLASS_ENTRY(ce,"myClass",myClass_methods);
| type | parameter | description |
|---|---|---|
| zend_class_entry | class_container | The container in which to store this class type |
| char* | class_name | The name of the class as seen in userspace |
| zend_function_entry[] | functions | Array of methods |
| handle_fcall | ||
| handle_propget | ||
| handle_propset |
You should use this macro to set class entry properties when you do not need to specify methods for equivalents to __isset() or __unset().
This is an alias for INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset, NULL, NULL)
| type | parameter | description |
|---|---|---|
| zend_class_entry | class_container | The container in which to store this class type |
| char* | class_name | The name of the class as seen in userspace |
| zend_function_entry[] | functions | Array of methods |
| handle_fcall | ||
| handle_propget | ||
| handle_propset | ||
| handle_propunset | ||
| handle_propisset |
In addition to the container properties that can be set using the parameters of this macro, several others are initialized.
Here is the complete list:
This is an alias for int ht, zval *return_value, zval **return_value_ptr, zval *this_ptr, int return_value_used TSRMLS_DC
This is an alias for ht, return_value, return_value_ptr, this_ptr, return_value_used TSRMLS_CC
An array zval is equivalent to an array of values in userspace
This is an alias for 4
A bool zval is equivalent to a bool value in userspace
This is an alias for 3
A constant zval is equivalent to a constant value in userspace
This is an alias for 8
A double zval is equivalent to a float value in userspace
This is an alias for 2
A long zval is equivalent to an integer value in userspace
This is an alias for 1
A NULL zval is equivalent to a null value in userspace
This is an alias for 0
An object zval is equivalent to an object in userspace
This is an alias for 5
A resource zval is equivalent to a resource in userspace
This is an alias for 7
A string zval is equivalent to a string value in userspace
This is an alias for 6
If not already defined by the compiler, this will be set to 2147483647
If not already defined, this is set to the inverse of LONG_MAX-1
| type | parameter | description |
|---|---|---|
| text | name | name of the function |
The reason zif_ should be added to zend internal function names is to avoid name conflicts.
Use of this macro is recomended over adding zif_ to the actual function names to ensure future compatibility.
zif stands for Zend Internal Function
This is an alias for "ZEND_FN(name)"
| type | parameter | description |
|---|---|---|
| text | name | name of the method |
The reason zim_ should be added to zend internal method names is to avoid name conflicts.
Use of this macro is recomended over adding zim_ to the actual method names to ensure future compatibility.
zim stands for Zend Internal Method
This is an alias for "ZEND_MN(name)"
This is an alias for 0
Generally you will use this with TSRMLS_D or TSRMLS_DC which are used to recieve this info in a function definition
This is esentially the same as TSRMLS_CC without the built-in preceding comma
This is an alias for tsrm_ls
Generally you will use this with TSRMLS_D or TSRMLS_DC which are used to recieve this info in a function definition
This is esentially the same as TSRMLS_C except it includes a preceding comma
This is an alias for , TSRMLS_C
Generally you will use this with TSRMLS_C or TSRMLS_CC which are used to pass this info to a function
This is esentially the same as TSRMLS_DC except without the built-in preceding comma
This is an alias for void ***tsrm_ls
Generally you will use this with TSRMLS_C or TSRMLS_CC which are used to pass this info to a function
This is esentially the same as TSRMLS_D except it includes a preceding comma
This is an alias for , TSRMLS_D
Example:
static zend_function_entry function_methods[] = {
PHP_ABSTRACT_ME(myClass,overloadMe,NULL)
{ NULL, NULL, NULL }
};
An abstract method cannot be called, it can only be overloaded
This is an alias for 0x02
Methods marked as final cannot be overloaded
This is an alias for 0x04
This is an alias for 0x08
This is an alias for (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE)
Methods declared private can be accessed only inside of the class in which they are declared
This is an alias for 0x400
Methods declared protected can be accessed only inside of the class in which in is declared or in derived classes
This is an alias for 0x200
Methods declared public can be accessed both inside and outside of a class instance
This is an alias for 0x100
Static methods do not need an instance of the class, but cannot use data that relies on non static class data. Because static methods are not tied to an instance of an object, you cannot use a ->, you must use ::
This is an alias for 0x01
Example: (PHP userspace code)
class a {
public static function bob() {
return "fred";
}
}
echo a::bob();
This is only used for code documentation scanners and does nothing whatsoever code-wise
| type | parameter | description |
|---|---|---|
| text | zend_name | userspace name of the function |
| text | internal | name of the function |
| zend_arg_info* | arg_info | |
| zend_uint | num_args | number of arguments |
| zend_uint | flags |
Alias for "{ #zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },"
Generally you will use this with ZEND_FILE_LINE_D or ZEND_FILE_LINE_DC, which are used to request this info in a function definition
This is esentially the same as ZEND_FILE_LINE_CC without the built-in preceding comma
If ZEND_DEBUG is not defined, this macro does nothing
This is an alias for __FILE__, __LINE__
Generally you will use this with ZEND_FILE_LINE_C, ZEND_FILE_LINE_CC, ZEND_FILE_LINE_EMPTY_C, or ZEND_FILE_LINE_EMPTY_CC which are used to pass this info to a function
This is esentially the same as ZEND_FILE_LINE_DC without the built-in preceding comma
If ZEND_DEBUG is not defined, this macro does nothing
This is an alias for char *__zend_filename, uint __zend_lineno
Generally you will use this with ZEND_FILE_LINE_C, ZEND_FILE_LINE_CC, ZEND_FILE_LINE_EMPTY_C, or ZEND_FILE_LINE_EMPTY_CC which are used to pass this info to a function
This is esentially the same as ZEND_FILE_LINE_D with a built-in preceding comma
If ZEND_DEBUG is not defined, this macro does nothing
This is an alias for , ZEND_FILE_LINE_D
| type | parameter | description |
|---|---|---|
| text | name | name of the function |
The reason zif_ should be added to zend internal function names is to avoid name conflicts.
Use of this macro is recomended over adding zif_ to the actual function names to ensure future compatibility.
zif stands for Zend Internal Function
This is an alias for "zif_##name"
expands to
ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
If not compiling with GCC, this is set to 0, otherwise this is an alias for (__GNUC__ * 1000 + __GNUC_MINOR__)
| type | parameter | description |
|---|---|---|
| text | classname | userpace name of the class of which this method will be a member |
| text | name | userspace name of this method |
| text | alias | userspace name of the method for which this method will be an alias |
| zend_arg_info* | arg_info | |
| zend_uint | flags |
Alias for "ZEND_FENTRY(name, ZEND_MN(classname##_##alias), arg_info, flags)"
Example:
static zend_function_entry function_methods[] = {
PHP_ME(myClass,funcOne,NULL,ZEND_ACC_PUBLIC)
PHP_MALIAS(myClass,funcTwo,funcOne,NULL,ZEND_ACC_PUBLIC)
{ NULL, NULL, NULL }
};
| type | parameter | description |
|---|---|---|
| text | classname | name of the userspace class |
| text | name | userspace name of the method |
| zend_arg_info* | arg_info | |
| zend_uint | flags |
Note: the classname and name parameters should be straight text, not a char*
This is an alias for "ZEND_FENTRY(name, ZEND_MN(classname##_##name), arg_info, flags)"
Example:
static zend_function_entry function_methods[] = {
PHP_ME(myClass,myMethod,NULL,ZEND_ACC_PUBLIC)
{ NULL, NULL, NULL }
};
| type | parameter | description |
|---|---|---|
| text | name | name of the method |
The reason zim_ should be added to zend internal method names is to avoid name conflicts.
Use of this macro is recomended over adding zim_ to the actual method names to ensure future compatibility.
zim stands for Zend Internal Method
This is an alias for "zim_##name"
expands to
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
This macro should always be used to pass the number of parameters when using Zend API functions like zend_parse_parameters
This is an alias for (ht)
HashTable*
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get the hash table |
This will not convert the data to a hash table
This macro is for use on zval variables, for zval* use Z_ARRVAL_P and for zval** use Z_ARRVAL_PP
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get a Boolean value |
This will not convert the data to a bool
This macro is for use on zval variables, for zval* use Z_BVAL_P and for zval** use Z_BVAL_PP
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get a double |
This will not convert the data to a double
This macro is for use on zval variables, for zval* use Z_DVAL_P and for zval** use Z_DVAL_PP
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get a long value |
This will not convert the data to a long
This macro is for use on zval variables, for zval* use Z_LVAL_P and for zval** use Z_LVAL_PP
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get the zend_class_entry |
This will not convert the data to an object
This macro is for use on zval variables, for zval* use Z_OBJCE_P and for zval** use Z_OBJCE_PP
This is an alias for zend_get_class_entry(&(zval) TSRMLS_CC)
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get the zend_object_value |
This will not convert the data to an object
This macro is for use on zval variables, for zval* use Z_OBJVAL_P and for zval** use Z_OBJVAL_PP
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get the zend_object_handle |
This will not convert the data to an object
This macro is for use on zval variables, for zval* use Z_OBJ_HANDLE_P and for zval** use Z_OBJ_HANDLE_PP
zend_object_handlers*
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get the zend_object_handlers |
This will not convert the data to an object
This macro is for use on zval variables, for zval* use Z_OBJ_HT_P and for zval** use Z_OBJ_HT_PP
int
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get the length a string value |
This will not convert the data to a string or int
This macro is for use on zval variables, for zval* use Z_STRLEN_P and for zval** use Z_STRLEN_PP
| type | parameter | description |
|---|---|---|
| zval | zval | the zval container from which to get a string value |
This will not convert the data to a bool
This macro is for use on zval variables, for zval* use Z_BVAL_P and for zval** use Z_BVAL_PP