summaryrefslogtreecommitdiff
path: root/ext/reflection/tests
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2018-06-28 12:37:33 +0800
committerXinchen Hui <laruence@gmail.com>2018-06-28 12:37:33 +0800
commit1f6b842af430b8cbba0fb1c38a2796ab399171c3 (patch)
treef22592309d8c1cb1ad50f3900f76f40955a18d73 /ext/reflection/tests
parentd1b1866a3a035b946e50b17eeefd19add81c7eab (diff)
downloadphp-git-1f6b842af430b8cbba0fb1c38a2796ab399171c3.tar.gz
Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence)
Diffstat (limited to 'ext/reflection/tests')
-rw-r--r--ext/reflection/tests/bug76536.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug76536.phpt b/ext/reflection/tests/bug76536.phpt
new file mode 100644
index 0000000000..9f3b3fdb31
--- /dev/null
+++ b/ext/reflection/tests/bug76536.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #76536 (PHP crashes with core dump when throwing exception in error handler)
+--FILE--
+<?php
+class SomeConstants {const SOME_CONSTANT = SOME_NONSENSE;}
+
+function handleError() {throw new ErrorException();}
+
+set_error_handler('handleError');
+set_exception_handler('handleError');
+
+$r = new \ReflectionClass(SomeConstants::class);
+$r->getConstants();
+?>
+--EXPECTF--
+Fatal error: Uncaught ErrorException in %sbug76536.php:%d
+Stack trace:
+#0 [internal function]: handleError(Object(ErrorException))
+#1 {main}
+ thrown in %sbug76536.php on line %d