summaryrefslogtreecommitdiff
path: root/Zend/tests/bug79599.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug79599.phpt')
-rw-r--r--Zend/tests/bug79599.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/Zend/tests/bug79599.phpt b/Zend/tests/bug79599.phpt
new file mode 100644
index 0000000000..da72d1c5b7
--- /dev/null
+++ b/Zend/tests/bug79599.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #79599 (coredump in set_error_handler)
+--FILE--
+<?php
+set_error_handler(function($code, $message){
+ throw new \Exception($message);
+});
+function test1(){
+ $a[] = $b;
+}
+function test2(){
+ $a[$c] = $b;
+}
+try{
+ test1();
+}catch(\Exception $e){
+ var_dump($e->getMessage());
+}
+try{
+ test2();
+}catch(\Exception $e){
+ var_dump($e->getMessage());
+}
+?>
+--EXPECT--
+string(21) "Undefined variable: b"
+string(21) "Undefined variable: c"