3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<JSON {"g_aaa77": {"'title'":"title2", "'r_a6cff'": {"name":"name2","price":"2"}, "'r_7fc7b'": {"name":"name22","price":"22"} }, "g_a36b5": {"title":"title1", "r_4e122": {"name":"name1","price":"1"}, "r_155fa": {"name":"name11","price":"11"} } } JSON; $array = json_decode($json, true); print_r($array); $array = array_values($array); print_r($array); echo $array[1]['title'];
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Array ( [g_aaa77] => Array ( ['title'] => title2 ['r_a6cff'] => Array ( [name] => name2 [price] => 2 ) ['r_7fc7b'] => Array ( [name] => name22 [price] => 22 ) ) [g_a36b5] => Array ( [title] => title1 [r_4e122] => Array ( [name] => name1 [price] => 1 ) [r_155fa] => Array ( [name] => name11 [price] => 11 ) ) ) Array ( [0] => Array ( ['title'] => title2 ['r_a6cff'] => Array ( [name] => name2 [price] => 2 ) ['r_7fc7b'] => Array ( [name] => name22 [price] => 22 ) ) [1] => Array ( [title] => title1 [r_4e122] => Array ( [name] => name1 [price] => 1 ) [r_155fa] => Array ( [name] => name11 [price] => 11 ) ) ) title1

preferences:
137.28 ms | 412 KiB | 5 Q