bug61767.phpt 857 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #61767 (Shutdown functions not called in certain error situation)
  3. --FILE--
  4. <?php
  5. set_error_handler(function($code, $msg, $file = null, $line = null) {
  6. echo "Error handler called ($msg)\n";
  7. throw new \ErrorException($msg, $code, 0, $file, $line);
  8. });
  9. register_shutdown_function(function(){
  10. echo "Shutting down\n";
  11. print_r(error_get_last());
  12. });
  13. //$undefined = null; // defined variable does not cause problems
  14. $undefined->foo();
  15. --EXPECTF--
  16. Error handler called (Undefined variable: undefined)
  17. Fatal error: Uncaught ErrorException: Undefined variable: undefined in %sbug61767.php:%d
  18. Stack trace:
  19. #0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d, Array)
  20. #1 {main}
  21. thrown in %sbug61767.php on line %d
  22. Shutting down
  23. Array
  24. (
  25. [type] => 1
  26. [message] => %a
  27. [file] => %sbug61767.php
  28. [line] => %d
  29. )