3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Data = json_decode(json_encode([4=>4,5=>5,6=>6])); var_dump($Data); $Data = (array)$Data; var_dump(array_keys($Data)); //var_dump($Data,$Data[4],$Data['4']); var_dump($Data[json_decode(json_encode("4"))]);
based on G2XlO
Output for 7.2.0 - 7.3.0alpha1
object(stdClass)#1 (3) { ["4"]=> int(4) ["5"]=> int(5) ["6"]=> int(6) } array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } int(4)
Output for 5.5.0 - 7.1.7
object(stdClass)#1 (3) { ["4"]=> int(4) ["5"]=> int(5) ["6"]=> int(6) } array(3) { [0]=> string(1) "4" [1]=> string(1) "5" [2]=> string(1) "6" } Notice: Undefined offset: 4 in /in/8aVGZ on line 9 NULL