php-src/Zend/tests/closure_022.phpt
Nikita Popov 008bfcc7ba Use NO_DYNAMIC_PROPERTIES for Closure
Instead of manually implementing this, use the standard mechanism.
This has minor behavior changes (e.g. doing an isset() will now
return false instead of throwing) which are more in line with
typical behavior.
2021-05-14 14:48:56 +02:00

15 lines
268 B
PHP

--TEST--
Closure 022: Closure properties
--FILE--
<?php
$a = 0;
$foo = function() use ($a) {
};
$foo->a = 1;
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot create dynamic property Closure::$a in %s:%d
Stack trace:
#0 {main}
thrown in %sclosure_022.php on line 5