3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array(); $array['foo'] = 'bar'; $array['foo']['bar'] = 'baz'; print_r($array); $array['foo']['bar'] = 2; $array['foo'] = 1; print_r($array);
Output for 5.4.0 - 7.2.0
Warning: Illegal string offset 'bar' in /in/8R0oX on line 5 Array ( [foo] => bar ) Warning: Illegal string offset 'bar' in /in/8R0oX on line 9 Array ( [foo] => 1 )
Output for 4.3.0 - 5.3.29
Array ( [foo] => bar ) Array ( [foo] => 1 )