|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-11-12 03:15 UTC] dreamsxin at qq dot com
Description: ------------ When enable opcache, `zend_set_user_opcode_handler(ZEND_INIT_METHOD_CALL, my_method_call_handler);` will not work. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 20:00:02 2025 UTC |
```c static int my_method_call_handler(zend_execute_data *execute_data) { zend_printf("hello\n"); // <-- No call return ZEND_USER_OPCODE_DISPATCH; } static PHP_MINIT_FUNCTION(phalcon) { zend_set_user_opcode_handler(ZEND_INIT_METHOD_CALL, my_method_call_handler); } ``` ```php $class = "string"; $class->test(); ``` php.ini: ```ini opcache.enable=1 ; 启用 Zend OPCache,在 CLI 模式下 opcache.enable_cli=1 ``` no output.`run php test.php` Normally, should be output : hello Hook `ZEND_INIT_METHOD_CALL`, call `zend_printf("hello\n");` But, it not work.