xref: /PHP-7.2/Zend/tests/bug76534.phpt (revision d1b1866a)
1--TEST--
2Bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)
3--FILE--
4<?php
5set_error_handler(function ($severity, $message, $file, $line) {
6	throw new \Exception($message);
7});
8
9$x = "foo";
10$y = &$x["bar"];
11?>
12--EXPECTF--
13Fatal error: Uncaught Exception: Illegal string offset 'bar' in %sbug76534.php:%d
14Stack trace:
15#0 %sbug76534.php(%d): {closure}(2, 'Illegal string ...', '%s', %d, Array)
16#1 {main}
17  thrown in %sbug76534.php on line %d
18