bug60909_2.phpt 594 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
  3. --FILE--
  4. <?php
  5. register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
  6. set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");});
  7. class Bad {
  8. public function __toString() {
  9. throw new Exception('Oops, I cannot do this');
  10. }
  11. }
  12. $bad = new Bad();
  13. echo "$bad";
  14. --EXPECTF--
  15. Fatal error: Method Bad::__toString() must not throw an exception, caught Exception: Oops, I cannot do this in %sbug60909_2.php on line %d
  16. !!!shutdown!!!