3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExtendedSPLHeap extends \SPLHeap { protected function compare2($a, $b) { if ($a->latitude == $b->latitude) { return 0; } return ($a->latitude < $b->latitude) ? -1 : 1; } } $citiesHeap = new \ExtendedSPLHeap(); $city = new \StdClass; $city->name = "Birmingham"; $city->latitude = 52.4800; $city->longitude = -1.9100; $citiesHeap->insert($city); $city = new \StdClass; $city->name = "Bristol"; $city->latitude = 51.4600; $city->longitude = -2.6000; $citiesHeap->insert($city); echo 'There are ', $citiesHeap->count(), ' cities in the heap', PHP_EOL; echo 'FROM NORTH TO SOUTH', PHP_EOL; $citiesHeap->top(); while ($citiesHeap->valid()) { $city = $citiesHeap->current(); echo sprintf( "%-20s %+3.4f %+3.4f" . PHP_EOL, $city->name, $city->latitude, $city->longitude ); $citiesHeap->next(); } echo 'There are ', $citiesHeap->count(), ' cities in the heap', PHP_EOL;

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)
5.4.160.0110.04312.38
5.4.150.0140.04312.38
5.4.140.0120.04212.07
5.4.130.0100.04612.05
5.4.120.0120.04412.01
5.4.110.0170.05512.01
5.4.100.0140.04012.01
5.4.90.0170.05012.00
5.4.80.0140.04612.01
5.4.70.0180.06012.00
5.4.60.0120.04412.00
5.4.50.0160.04612.00
5.4.40.0130.04812.00
5.4.30.0160.05111.99
5.4.20.0160.06011.99
5.4.10.0170.05511.99
5.4.00.0110.04511.48
5.3.260.0130.04512.72
5.3.250.0130.04312.72
5.3.240.0140.04512.72
5.3.230.0190.05912.71
5.3.220.0170.05212.68
5.3.210.0150.04612.68
5.3.200.0130.04512.68
5.3.190.0120.04812.68
5.3.180.0130.04912.67
5.3.170.0120.04412.67
5.3.160.0180.05412.67
5.3.150.0140.04512.67
5.3.140.0220.06112.66
5.3.130.0130.04812.66
5.3.120.0190.04712.66
5.3.110.0150.05012.66
5.3.100.0200.07312.12
5.3.90.0140.04712.10
5.3.80.0150.05112.08
5.3.70.0180.06212.08
5.3.60.0150.04412.07
5.3.50.0170.04912.02
5.3.40.0140.04112.02
5.3.30.0180.04911.98
5.3.20.0180.06111.76
5.3.10.0120.04111.73
5.3.00.0130.04211.71

preferences:
143.78 ms | 1394 KiB | 7 Q