closure_031.phpt 371 B

12345678910111213141516171819
  1. --TEST--
  2. Closure 031: Closure properties with custom error handlers
  3. --FILE--
  4. <?php
  5. function foo($errno, $errstr, $errfile, $errline) {
  6. echo "Warning: $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. Warning: Undefined property: Closure::$a
  19. NULL