Skip to content

Instantly share code, notes, and snippets.

@nielsdos
Created April 9, 2024 20:13
Show Gist options
  • Save nielsdos/4f43354948de79a82fe2ea0b813ddcf2 to your computer and use it in GitHub Desktop.
Save nielsdos/4f43354948de79a82fe2ea0b813ddcf2 to your computer and use it in GitHub Desktop.
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index f72cb76489..6aba277c44 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -30,6 +30,7 @@
#include "zend_closures.h"
#include "zend_compile.h"
#include "zend_hash.h"
+#include "zend_observer.h"
#define DEBUG_OBJECT_HANDLERS 0
@@ -1353,6 +1354,7 @@ ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce
* frame. This didn't cause any issues until now due to "lucky" structure layout. */
func->last_var = 0;
func->T = (fbc->type == ZEND_USER_FUNCTION)? MAX(fbc->op_array.last_var + fbc->op_array.T, 2) : 2;
+ func->T += ZEND_OBSERVER_ENABLED;
func->filename = (fbc->type == ZEND_USER_FUNCTION)? fbc->op_array.filename : ZSTR_EMPTY_ALLOC();
func->line_start = (fbc->type == ZEND_USER_FUNCTION)? fbc->op_array.line_start : 0;
func->line_end = (fbc->type == ZEND_USER_FUNCTION)? fbc->op_array.line_end : 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment