File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -2749,12 +2749,10 @@ ZEND_METHOD(reflection_method, invokeArgs)
2749
2749
fcc .object_ptr = object ;
2750
2750
2751
2751
/*
2752
- * Closure::__invoke() actually expects a copy of zend_function, so that it
2753
- * frees it after the invoking.
2752
+ * Copy the zend_function when calling via handler (e.g. Closure::__invoke())
2754
2753
*/
2755
- if (obj_ce == zend_ce_closure && object &&
2756
- strlen (mptr -> common .function_name ) == sizeof (ZEND_INVOKE_FUNC_NAME )- 1 &&
2757
- memcmp (mptr -> common .function_name , ZEND_INVOKE_FUNC_NAME , sizeof (ZEND_INVOKE_FUNC_NAME )- 1 ) == 0 ) {
2754
+ if (mptr -> type == ZEND_INTERNAL_FUNCTION &&
2755
+ (mptr -> internal_function .fn_flags & ZEND_ACC_CALL_VIA_HANDLER ) != 0 ) {
2758
2756
fcc .function_handler = _copy_function (mptr TSRMLS_CC );
2759
2757
}
2760
2758
You can’t perform that action at this time.
0 commit comments