3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php $resdata = array( array( array( "prefix" => 93, "rate" => "0.172962000", "destination" => "Afghanistan" ) ), array( array( "prefix" => 9320, "rate" => 0, "destination" => "Afghanistan (ON-NET)" ) ), array( array( "prefix" => 9350, "rate" => 0, "destination" => "Afghanistan (ON-NET)" ) ), array( array( "prefix" => 935, "rate" => "0.451478000", "destination" => "Afghanistan (ON-NET)" ) ), array( array( "prefix" => 9360, "rate" => 0, "destination" => "Afghanistan (ON-NET)" ) ) ); function getRate($items, $prefix) { while($prefix = $prefix/10) { foreach ($items as $key => $value) { if ($value[0]["prefix"] === (int)$prefix) { return $value[0]["rate"]; } } } return null; }; foreach ($resdata as $key => $row) { if($row[0]['rate'] === 0) { $rate = getRate($resdata, $row[0]['prefix']); if ($rate) { $resdata[$key][0]['rate'] = $rate; } } } print_r($resdata);

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)
7.0.00.0130.07320.10
5.6.160.0070.08020.71
5.6.150.0070.05718.23
5.6.140.0030.04018.23
5.6.130.0100.03318.29
5.6.120.0070.03721.12
5.6.110.0070.09021.00
5.6.100.0070.08320.98
5.6.90.0200.07321.13
5.6.80.0030.04020.56
5.5.300.0030.06317.97
5.5.290.0070.07717.98
5.5.280.0030.04020.87
5.5.270.0170.05720.89
5.5.260.0070.09020.76
5.5.250.0000.04320.77
5.5.240.0070.03720.18

preferences:
133.18 ms | 1398 KiB | 7 Q