1.利用php-src提供的工具生成扩展的骨架
sudo ./ext_skel.php --ext testclass
2.添加类和接口的声明php_testclass.h中
PHP_METHOD(TestClass, __construct);
PHP_METHOD(TestClass, hello);
3.php_testclass.c中
static const zend_function_entry date_funcs_date[] = {
PHP_ME(DateTime, __construct, NULL, ZEND_ACC_PUBLIC)
PHP_ME(DateTime, hello, NULL, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(test1, testclass_test1, arginfo_testclass_test1, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(test2, testclass_test2, arginfo_testclass_test2, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_FE_END
};
4.