
1、cd ext
2、./ext_skel --extname=helloworld
3、vim config.m4
去掉注释:
PHP_ARG_WITH(helloworld, for helloworld support,
Make sure that the comment is aligned:
[ --with-helloworld Include helloworld support])
4、/usr/local/php-7.1.0/bin/phpize
5、vim helloworld.c
/*
* #define ZEND_FN(name) zif_##name
* #define ZEND_MN(name) zim_##name
* #define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
* #define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
* #define INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value
*
*实际上宏替换的函数为
* zif_hellowor