3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('serialize_precision', 60); // ini_set('serialize_precision', -1); echo 'serialize_precision: ', ini_get('serialize_precision'), PHP_EOL; $points = [ [45.29077, 5.63361], [45.29083, 5.63384] ]; $feature = [ "type" => "Feature", "geometry" => [ "type" => "LineString", "coordinates" => array_map('array_reverse', $points) ], "properties" => [] ]; $json_parcours = [ "type" => "FeatureCollection", "features" => [$feature] ]; $jsonData = json_encode($json_parcours, JSON_UNESCAPED_UNICODE); echo 'jsonData = ', $jsonData, PHP_EOL;

preferences:
34.5 ms | 407 KiB | 5 Q