|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #80350 zend_set_user_opcode_handler not work
Submitted: 2020-11-12 03:15 UTC Modified: 2020-11-30 19:46 UTC
From: dreamsxin at qq dot com Assigned: dmitry (profile)
Status: Closed Package: JIT
PHP Version: 8.0.0RC3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
43 - 28 = ?
Subscribe to this entry?

 [2020-11-12 03:15 UTC] dreamsxin at qq dot com
When enable opcache,
`zend_set_user_opcode_handler(ZEND_INIT_METHOD_CALL, my_method_call_handler);`
will not work.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-12 03:20 UTC]
-Status: Open +Status: Feedback
 [2020-11-12 03:20 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

 [2020-11-12 03:25 UTC] dreamsxin at qq dot com
-Status: Feedback +Status: Open
 [2020-11-12 03:25 UTC] dreamsxin at qq dot com
static int my_method_call_handler(zend_execute_data *execute_data)
	zend_printf("hello\n"); // <-- No call

static PHP_MINIT_FUNCTION(phalcon)
	zend_set_user_opcode_handler(ZEND_INIT_METHOD_CALL, my_method_call_handler);
$class = "string";
; 启用 Zend OPCache,在 CLI 模式下 
no output.
 [2020-11-12 03:40 UTC]
-Status: Open +Status: Feedback
 [2020-11-12 03:40 UTC]
Hi Dreamsxin,

I find it hard to understand this bug report.

I can see you are using an extension with the name Phalcon - but my understanding is that Phalcon itself is not compatible with PHP 8 yet:

It may be better to talk to the Phalcon people and explain what problem you're having with them, or just wait for Phalcon to support PHP 8.

Otherwise, we would probably need more details of what you are attemting, why you think it should work, and why you think it's a problem to be fixed in PHP.
 [2020-11-12 03:46 UTC] dreamsxin at qq dot com
-Status: Feedback +Status: Open
 [2020-11-12 03:46 UTC] dreamsxin at qq dot com
`run php test.php`

Normally, should be output : hello

Hook `ZEND_INIT_METHOD_CALL`, call `zend_printf("hello\n");`

But, it not work.
 [2020-11-12 03:48 UTC] dreamsxin at qq dot com
Like this extension,
When disable opcache work fine.
But enable can't work.
 [2020-11-17 09:43 UTC]
-Assigned To: +Assigned To: dmitry
 [2020-11-17 09:43 UTC]
@dmitry: I'm wondering whether we should respect user opcode handlers in JIT. It seems like it should be possible, but maybe user opcode handlers break assumptions by type inference etc.
 [2020-11-17 21:41 UTC]
-Type: Bug +Type: Feature/Change Request
 [2020-11-17 21:41 UTC]
I think we shouldn't support user opcode handlers in JIT.

I don't see a way to handle all possible return values (e.g 
ZEND_USER_OPCODE_DISPATCH) and ability to jump (change EX(opline)).

In general, for each user opcode handler, we may transfer control to interpreter.
 [2020-11-24 13:50 UTC]
That makes sense. Just not JITing when a user opcode handler is involved seems reasonable.
 [2020-11-30 19:46 UTC]
-Status: Assigned +Status: Closed
 [2020-11-30 19:46 UTC]
Fixed by d5a82e2c4eebe8337ff7790db46d812af2fbcec9
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jun 13 15:01:24 2021 UTC