3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php const foo = 3; $bar = new stdClass(); $bar->{foo} = 'baz'; var_dump($bar); foreach ($bar as $k => $v) { echo PHP_EOL . $bar->$k . ' = ' . $v . PHP_EOL; }
based on 81aW5
Output for 5.6.38 - 7.3.0rc3
object(stdClass)#1 (1) { ["3"]=> string(3) "baz" } baz = baz