mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
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.
23 lines
313 B
PHP
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
|