#ifndef PHP_DEC_INTERCEPTOR_H #define PHP_DEC_INTERCEPTOR_H #include "php.h" #include "zend_compile.h" #define PHP_DEC_INTERCEPTOR_VERSION "0.1.0" extern zend_module_entry dec_interceptor_module_entry; #define phpext_dec_interceptor_ptr &dec_interceptor_module_entry /* ✅ 正确的函数指针类型 */ extern zend_op_array *(*original_compile_string)(zval *source_string, const char *filename); /* ✅ 正确的 hook 函数声明 */ zend_op_array *custom_compile_string(zval *source_string, const char *filename); /* 模块生命周期函数 */ PHP_MINIT_FUNCTION(dec_interceptor); PHP_MSHUTDOWN_FUNCTION(dec_interceptor); PHP_MINFO_FUNCTION(dec_interceptor); #endif /* PHP_DEC_INTERCEPTOR_H */