3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '[{"lat":-2.1581795660883976,"lng":-79.90096002817154},{"lat":-2.171559596852916,"lng":-79.9018183350563},{"lat":-2.176448424731824,"lng":-79.89057451486588},{"lat":-2.1662419064644722,"lng":-79.88053232431412},{"lat":-2.156206859267206,"lng":-79.8930636048317},{"lat":-2.15835110569104,"lng":-79.90164667367935}]'; var_dump(json_decode($str));
Output for 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(6) { [0]=> object(stdClass)#1 (2) { ["lat"]=> float(-2.1581795660883976) ["lng"]=> float(-79.90096002817154) } [1]=> object(stdClass)#2 (2) { ["lat"]=> float(-2.171559596852916) ["lng"]=> float(-79.9018183350563) } [2]=> object(stdClass)#3 (2) { ["lat"]=> float(-2.176448424731824) ["lng"]=> float(-79.89057451486588) } [3]=> object(stdClass)#4 (2) { ["lat"]=> float(-2.1662419064644722) ["lng"]=> float(-79.88053232431412) } [4]=> object(stdClass)#5 (2) { ["lat"]=> float(-2.156206859267206) ["lng"]=> float(-79.8930636048317) } [5]=> object(stdClass)#6 (2) { ["lat"]=> float(-2.15835110569104) ["lng"]=> float(-79.90164667367935) } }
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.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
array(6) { [0]=> object(stdClass)#1 (2) { ["lat"]=> float(-2.1581795660884) ["lng"]=> float(-79.900960028172) } [1]=> object(stdClass)#2 (2) { ["lat"]=> float(-2.1715595968529) ["lng"]=> float(-79.901818335056) } [2]=> object(stdClass)#3 (2) { ["lat"]=> float(-2.1764484247318) ["lng"]=> float(-79.890574514866) } [3]=> object(stdClass)#4 (2) { ["lat"]=> float(-2.1662419064645) ["lng"]=> float(-79.880532324314) } [4]=> object(stdClass)#5 (2) { ["lat"]=> float(-2.1562068592672) ["lng"]=> float(-79.893063604832) } [5]=> object(stdClass)#6 (2) { ["lat"]=> float(-2.158351105691) ["lng"]=> float(-79.901646673679) } }

preferences:
52.58 ms | 411 KiB | 5 Q