3v4l.org

run code in 300+ PHP versions simultaneously
<?php $points = Array ( Array ( 45.29077, 5.63361 ), Array ( 45.29083, 5.63384 ) ); echo 'points = '; print_r($points); $json_parcours = array("type"=>"FeatureCollection", "features"=>array()); $coord_bdd = array(); foreach($points as $value){ //echo gettype($value[1]).' : '; $round1 = substr($value[1],0,7); $round2 = sprintf('%f.5', $value[0]); $round1 = floatval($round1); $round2 = floatval($round2); array_push($coord_bdd,array($round1,$round2)); //echo $round1.', '.$round2.'<br />'; echo '<br/><br/>coord_bdd = '; print_r($coord_bdd); } array_push($json_parcours["features"],array("type"=>"Feature","geometry"=>array("type"=>"LineString","coordinates"=>$coord_bdd),"properties"=>array())); $jsonData = json_encode($json_parcours,JSON_UNESCAPED_UNICODE); // Convertir le tableau en JSON echo '<br/><br/>jsonData = '; print_r($jsonData);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.130.0080.00317.59
8.4.120.0130.00824.27
8.4.110.0120.00818.83
8.4.100.0100.01017.94
8.4.90.0080.01017.64
8.4.80.0140.00619.69
8.4.70.0070.00517.68
8.4.60.0110.01019.36
8.4.50.0110.00818.94
8.4.40.0140.00718.72
8.4.30.0000.01118.86
8.4.20.0060.00321.33
8.4.10.0030.00619.68
8.3.260.0130.00716.50
8.3.250.0110.00518.71
8.3.240.0090.01016.45
8.3.230.0130.00616.70
8.3.220.0080.01016.84
8.3.210.0090.01216.57
8.3.200.0050.00916.73
8.3.190.0030.00517.16
8.3.180.0070.01218.82
8.3.170.0060.00317.02
8.3.160.0110.00716.73
8.3.150.0110.00716.97
8.3.140.0040.00416.85
8.3.130.0090.00016.80
8.3.120.0060.00316.52
8.3.50.0000.00916.70
8.2.290.0090.00218.62
8.2.280.0080.01016.60
8.2.270.0130.00616.55
8.2.260.0070.00717.04
8.2.250.0060.00316.79
8.2.240.0000.00816.54
8.1.330.0140.00516.06
8.1.320.0110.00818.09
8.1.310.0120.00616.42
8.1.300.0080.00016.21
5.4.00.0090.01016.21

preferences:
34.69 ms | 403 KiB | 5 Q