closure_031.phpt 359 B

123456789101112131415161718
  1. --TEST--
  2. Closure 031: Closure properties with custom error handlers
  3. --FILE--
  4. <?php
  5. function foo($errno, $errstr, $errfile, $errline) {
  6. echo "Error: $errstr\n";
  7. }
  8. set_error_handler('foo');
  9. $foo = function() {
  10. };
  11. try {
  12. var_dump($foo->a);
  13. } catch (Error $ex) {
  14. echo "Error: {$ex->getMessage()}\n";
  15. }
  16. ?>
  17. --EXPECT--
  18. Error: Closure object cannot have properties