summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2018-06-27 13:05:11 +0800
committerXinchen Hui <laruence@gmail.com>2018-06-27 13:05:11 +0800
commitd1b1866a3a035b946e50b17eeefd19add81c7eab (patch)
tree7ead754956797c40fb68a7f3b26d3872532b1fb7 /Zend/tests
parent6b5597f7d8e31933dfb833dd443290adc02ca307 (diff)
downloadphp-git-d1b1866a3a035b946e50b17eeefd19add81c7eab.tar.gz
Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/bug76534.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/tests/bug76534.phpt b/Zend/tests/bug76534.phpt
new file mode 100644
index 0000000000..956a29ba2c
--- /dev/null
+++ b/Zend/tests/bug76534.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)
+--FILE--
+<?php
+set_error_handler(function ($severity, $message, $file, $line) {
+ throw new \Exception($message);
+});
+
+$x = "foo";
+$y = &$x["bar"];
+?>
+--EXPECTF--
+Fatal error: Uncaught Exception: Illegal string offset 'bar' in %sbug76534.php:%d
+Stack trace:
+#0 %sbug76534.php(%d): {closure}(2, 'Illegal string ...', '%s', %d, Array)
+#1 {main}
+ thrown in %sbug76534.php on line %d