ru_php/Zend/tests/dynamic_prop_deprecation_002.phpt

19 lines
420 B
PHP

--TEST--
Dynamic properties deprecation 002 (memory leak)
--FILE--
<?php
set_error_handler(function($code, $msg){
echo "Err: $msg\n";
$GLOBALS['a']=null;
});
$a = new class{};
try {
[&$a->y];
} catch (Throwable $ex) {
echo "Exception: " .$ex->getMessage() . "\n";
}
?>
--EXPECT--
Err: Creation of dynamic property class@anonymous::$y is deprecated
Exception: Cannot create dynamic property class@anonymous::$y