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