exception_handler_002.phpt 464 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. exception handler tests - 2
  3. --FILE--
  4. <?php
  5. set_exception_handler("foo");
  6. function foo($e) {
  7. var_dump(get_class($e)." thrown!");
  8. throw new Exception();
  9. }
  10. class test extends Exception {
  11. }
  12. throw new test();
  13. echo "Done\n";
  14. ?>
  15. --EXPECTF--
  16. string(12) "test thrown!"
  17. Fatal error: Uncaught Exception in %sexception_handler_002.php:7
  18. Stack trace:
  19. #0 [internal function]: foo(Object(test))
  20. #1 {main}
  21. thrown in %sexception_handler_002.php on line %d