methods-on-non-objects-catch.phpt 375 B

1234567891011121314151617181920
  1. --TEST--
  2. Catch method calls on non-objects raise recoverable errors
  3. --FILE--
  4. <?php
  5. set_error_handler(function($code, $message) {
  6. var_dump($code, $message);
  7. });
  8. $x= null;
  9. try {
  10. var_dump($x->method());
  11. } catch (Error $e) {
  12. var_dump($e->getCode(), $e->getMessage());
  13. }
  14. echo "Alive\n";
  15. ?>
  16. --EXPECTF--
  17. int(0)
  18. string(%d) "Call to a member function method() on null"
  19. Alive