3v4l.org

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