3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $object = new stdClass(); $object->{'1'} = 'one'; $array = (array) $object; var_dump($array); echo $array[('1')];
based on VGpKM
Output for 7.2.0
array(1) { [1]=> string(3) "one" } one
Output for 5.4.9 - 7.1.10
array(1) { ["1"]=> string(3) "one" } Notice: Undefined offset: 1 in /in/RHYm3 on line 11
Output for 5.3.19 - 5.3.29
array(1) { ["1"]=> string(3) "one" } Notice: Undefined index: 1 in /in/RHYm3 on line 11