3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fruit = array('apples'=>2, 'oranges'=>5, 'pears'=>0); echo $fruit['oranges']; // echoes 5 $fruit = "new string"; echo $fruit['oranges']; // causes illegal string offset error
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
5 Warning: Illegal string offset 'oranges' in /in/dbEhh on line 7 n
Output for 5.3.7 - 5.3.29, hhvm-3.12.0
5n
Output for hhvm-3.10.0

Process exited with code 153.