3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); $obj->{123} = "foo"; $obj->{'456'} = "bar"; $arr = (array)$obj; var_dump(serialize($obj), serialize($arr));
based on fGY9u
Output for 5.0.0 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
string(59) "O:8:"stdClass":2:{s:3:"123";s:3:"foo";s:3:"456";s:3:"bar";}" string(46) "a:2:{s:3:"123";s:3:"foo";s:3:"456";s:3:"bar";}"
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.3 - 4.4.9
Fatal error: Property name must be a string in /in/tobZi on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.2

Process exited with code 139.