PHP_FE宏替换过程:
PHP扩展研究之 PHP_FE 宏替换过程:
// zend函数入口
const zend_function_entry helloworld_functions[] = {
// PHP_FE(array_max,NULL) // 此处和下面写法效果相等
{
"array_max",
zif_array_max,
NULL,
(zend_uint)(sizeof(NULL) / sizeof(struct _zend_arg_info) - 1),
0
},
PHP_FE_END /* Must be the last line in helloworld_functions[] */
};
替换之前:
PHP_FE(array_max,NULL)
第1次替换:
ZEND_FE(array_max,NULL)
第2次替换:
ZEND_FENTRY(array_max, zif_array_max, NULL, 0)
第3次替换:
ZEND_FENTRY(array_max, zif_array_max, NULL, 0)
第4次替换:
{
'array_max',
zif_array_max,
NULL,
(zend_uint) (sizeof(NULL) / sizeof(struct _zend_arg_info)-1),
0
},