php-src/Zend/tests/closure_write_prop.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

23 lines
313 B
PHP

--TEST--
Cannot write to closure properties
--FILE--
<?php
class A {
function getFn() {
return function() {
};
}
}
$a = new A;
try {
$c = $a->getFn()->b = new stdClass;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot create dynamic property Closure::$b