summaryrefslogtreecommitdiff
path: root/Zend/tests/bug60909_2.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug60909_2.phpt')
-rw-r--r--Zend/tests/bug60909_2.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/tests/bug60909_2.phpt b/Zend/tests/bug60909_2.phpt
new file mode 100644
index 0000000000..d08d9f90fa
--- /dev/null
+++ b/Zend/tests/bug60909_2.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
+--FILE--
+<?php
+register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
+set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");});
+
+class Bad {
+ public function __toString() {
+ throw new Exception('Oops, I cannot do this');
+ }
+}
+
+$bad = new Bad();
+echo "$bad";
+--EXPECTF--
+Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
+
+
+!!!shutdown!!!