mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
008bfcc7ba
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.
15 lines
268 B
PHP
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
|