3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = new stdClass; $x->{42} = 1; $y = (array)$x; echo json_encode($x); echo json_encode($y); echo $y[42];
based on Vv7VB
Output for 7.2.0
{"42":1}{"42":1}1
Output for 5.5.0 - 7.1.10
{"42":1}{"42":1} Notice: Undefined offset: 42 in /in/G0UJa on line 8