3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = (object) array('' => 'empty', '1' => 'one'); foreach ($foo as $k=>$v) { echo "'$k' -> '$v'\n"; }
Output for 4.3.0 - 4.4.9, hhvm-3.10.0 - 3.12.0, 7.1.0
'' -> 'empty' '1' -> 'one'
Output for 5.6.21 - 5.6.28, 7.0.6 - 7.0.14
'1' -> 'one'
Output for 5.2.1 - 5.6.20, 7.0.0 - 7.0.5
Notice: Illegal member variable name in /in/fHLvA on line 4 '1' -> 'one'
Output for 5.2.0
Notice: Illegal member variable name in /in/fHLvA on line 4 Notice: Illegal member variable name in /in/fHLvA on line 4
Output for 5.0.0 - 5.1.6