1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 03:22:58 +02:00
Files
archived-php-src/Zend/tests/bug73792.phpt
2020-07-10 21:05:28 +02:00

21 lines
390 B
PHP

--TEST--
Bug #73792 (invalid foreach loop hangs script)
--FILE--
<?php
$a = 'aaa';
foreach ($a['bbb'] as &$value) {
echo 'loop';
}
unset($value);
echo 'done';
?>
--EXPECTF--
Warning: Illegal string offset "bbb" in %s on line %d
Fatal error: Uncaught Error: Cannot iterate on string offsets by reference in %sbug73792.php:4
Stack trace:
#0 {main}
thrown in %sbug73792.php on line 4