3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = new stdclass; $x->{42} = 1337; $x = (array)$x; var_dump($x); //$x = array("42" => 1337); foreach ($x as $key => $value) { var_dump($key); if (!array_key_exists((string)$key, $x)) echo 'wtf'; } ?>
based on MTeS7
Output for 7.2.0
array(1) { [42]=> int(1337) } int(42)
Output for 5.3.17 - 7.1.10
array(1) { ["42"]=> int(1337) } string(2) "42" wtf