xref: /PHP-8.1/Zend/tests/closure_022.phpt (revision 008bfcc7)
1--TEST--
2Closure 022: Closure properties
3--FILE--
4<?php
5$a = 0;
6$foo = function() use ($a) {
7};
8$foo->a = 1;
9?>
10--EXPECTF--
11Fatal error: Uncaught Error: Cannot create dynamic property Closure::$a in %s:%d
12Stack trace:
13#0 {main}
14  thrown in %sclosure_022.php on line 5
15