3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $o = (object) array( "foo" => 42, "" => 37, "bar" => 19, ); echo "ok\n"; foreach ($o as $p => $v) { var_dump($p); }
Output for 4.3.0 - 4.4.9, 7.1.0
ok string(3) "foo" string(0) "" string(3) "bar"
Output for 5.0.0 - 5.4.45, 5.6.21 - 5.6.28, 7.0.6 - 7.0.14
ok string(3) "foo" string(3) "bar"
Output for 7.0.0 - 7.0.5
ok Notice: Illegal member variable name in /in/GAmGT on line 8 string(3) "foo" string(3) "bar"
Output for 5.5.0 - 5.6.20
ok string(3) "foo" Notice: Illegal member variable name in /in/GAmGT on line 8 string(3) "bar"