3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo['bar']['baz'] = 'foo'; foreach($foo['bar'] ?: [] as &$val) { $val = 'FOO'; } var_dump($foo);
based on Nps44
Output for 7.0.0 - 7.2.0
array(1) { ["bar"]=> array(1) { ["baz"]=> string(3) "foo" } }
Output for 5.5.0 - 5.6.28
array(1) { ["bar"]=> array(1) { ["baz"]=> &string(3) "FOO" } }