3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new StdClass; $obj->{12} = 234; ${1} = 567; var_dump($obj, ${1}); var_dump($obj->{12}); $ary = (array)$obj; var_dump($ary); var_dump($ary[12]);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
object(stdClass)#1 (1) { ["12"]=> int(234) } int(567) int(234) array(1) { ["12"]=> int(234) } Notice: Undefined offset: 12 in /in/vkWr7 on line 9 NULL
Output for hhvm-3.10.0 - 3.13.2
object(stdClass)#1 (1) { ["12"]=> int(234) } int(567) int(234) array(1) { ["12"]=> int(234) } Notice: Undefined index: 12 in /in/vkWr7 on line 9 NULL
Output for 5.0.0 - 5.2.17
object(stdClass)#1 (1) { ["12"]=> int(234) } int(567) int(234) array(1) { ["12"]=> int(234) } Notice: Undefined offset: 12 in /in/vkWr7 on line 9 NULL
Output for 4.3.3 - 4.4.9
Fatal error: Property name must be a string in /in/vkWr7 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.2

Process exited with code 139.