xref: /PHP-7.0/Zend/tests/bug73792.phpt (revision 3c6a2fb0)
1--TEST--
2Bug #73792 (invalid foreach loop hangs script)
3--FILE--
4<?php
5$a = 'aaa';
6
7foreach ($a['bbb'] as &$value) {
8	echo 'loop';
9}
10
11unset($value);
12echo 'done';
13?>
14--EXPECTF--
15Warning: Illegal string offset 'bbb' in %sbug73792.php on line 4
16
17Fatal error: Uncaught Error: Cannot iterate on string offsets by reference in %sbug73792.php:4
18Stack trace:
19#0 {main}
20  thrown in %sbug73792.php on line 4
21