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

20 lines
371 B
PHP

--TEST--
Closure 031: Closure properties with custom error handlers
--FILE--
<?php
function foo($errno, $errstr, $errfile, $errline) {
echo "Warning: $errstr\n";
}
set_error_handler('foo');
$foo = function() {
};
try {
var_dump($foo->a);
} catch (Error $ex) {
echo "Error: {$ex->getMessage()}\n";
}
?>
--EXPECT--
Warning: Undefined property: Closure::$a
NULL