3v4l.org

run code in 200+ 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, hhvm-3.10.1 - 3.17.3, 7.1.0 - 7.1.10
ok string(3) "foo" string(0) "" string(3) "bar"
Output for 5.0.0 - 5.1.6, 5.6.21 - 5.6.30, 7.0.6 - 7.0.20
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.2.0 - 5.6.20
ok string(3) "foo" Notice: Illegal member variable name in /in/GAmGT on line 8 string(3) "bar"