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) /* {{{ */
695695{
696696 zend_closure * closure = (zend_closure * )ZEND_CLOSURE_OBJECT (EX (func ));
697697 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 ;
699701}
700702/* }}} */
701703
Original file line number Diff line number Diff line change @@ -7,9 +7,7 @@ zend_test.observer.enabled=1
77zend_test.observer.observe_all=1
88--FILE--
99<?php
10- $ closure = strlen (...);
11- var_dump ($ closure ('test ' ));
12-
10+ var_dump (strlen (...)('test ' ));
1311echo 'DONE ' . PHP_EOL ;
1412?>
1513--EXPECTF--
You can’t perform that action at this time.
0 commit comments