php-src/Zend/tests/string_offset_optimization.phpt
Nikita Popov b743cd72d0 Fix inference if FETCH_DIM_W user optimized away
In this case the user may be a FREE.

Also add the test file that I forgot in
3ce472d1a6.
2021-10-21 09:58:07 +02:00

17 lines
326 B
PHP

--TEST--
Invalid string offset use where the actual use may be optimized away
--FILE--
<?php
function test() {
$a = "";
$c = array(&$a[0]);
}
test();
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}
thrown in %s on line %d