File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -695,7 +695,9 @@ static ZEND_NAMED_FUNCTION(zend_closure_internal_handler) /* {{{ */
695
695
{
696
696
zend_closure * closure = (zend_closure * )ZEND_CLOSURE_OBJECT (EX (func ));
697
697
closure -> orig_internal_handler (INTERNAL_FUNCTION_PARAM_PASSTHRU );
698
- OBJ_RELEASE ((zend_object * )closure );
698
+ // Assign to EX(this) so that it is released after observer checks etc.
699
+ ZEND_ADD_CALL_FLAG (execute_data , ZEND_CALL_RELEASE_THIS );
700
+ Z_OBJ (EX (This )) = & closure -> std ;
699
701
}
700
702
/* }}} */
701
703
Original file line number Diff line number Diff line change @@ -7,9 +7,7 @@ zend_test.observer.enabled=1
7
7
zend_test.observer.observe_all=1
8
8
--FILE--
9
9
<?php
10
- $ closure = strlen (...);
11
- var_dump ($ closure ('test ' ));
12
-
10
+ var_dump (strlen (...)('test ' ));
13
11
echo 'DONE ' . PHP_EOL ;
14
12
?>
15
13
--EXPECTF--
You can’t perform that action at this time.
0 commit comments