3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExtendedSPLHeap extends \SPLHeap { protected function compare($a, $b) { if ($a->latitude == $b->latitude) { return 0; } return ($a->latitude < $b->latitude) ? -1 : 1; } } $citiesHeap = new \SplMaxHeap(); $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(); } $citiesHeap->top(); echo $citiesHeap->rewind(); 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)
8.3.60.0040.01116.50
8.3.50.0120.00717.38
8.3.40.0060.00919.02
8.3.30.0110.00318.97
8.3.20.0040.00418.76
8.3.10.0060.00320.71
8.3.00.0040.00419.50
8.2.180.0150.00016.75
8.2.170.0100.00522.96
8.2.160.0070.00720.53
8.2.150.0050.00324.18
8.2.140.0000.00724.66
8.2.130.0000.00926.16
8.2.120.0000.00719.76
8.2.110.0060.00321.04
8.2.100.0030.00917.85
8.2.90.0050.00219.09
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0040.00418.04
8.2.50.0000.00918.07
8.2.40.0060.00320.01
8.2.30.0040.00418.09
8.2.20.0030.00617.75
8.2.10.0030.00619.50
8.2.00.0000.00817.58
8.1.280.0100.01325.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00020.74
8.1.230.0060.00620.88
8.1.220.0000.00918.77
8.1.210.0000.00818.88
8.1.200.0030.00717.35
8.1.190.0040.00417.40
8.1.180.0080.00018.10
8.1.170.0050.00318.74
8.1.160.0040.00418.86
8.1.150.0000.00818.60
8.1.140.0000.00717.34
8.1.130.0030.00517.78
8.1.120.0000.00717.31
8.1.110.0000.00717.34
8.1.100.0040.00417.36
8.1.90.0080.00017.32
8.1.80.0030.00317.44
8.1.70.0030.00317.41
8.1.60.0000.00817.57
8.1.50.0040.00417.54
8.1.40.0070.00017.57
8.1.30.0000.00817.68
8.1.20.0030.00517.63
8.1.10.0000.00817.61
8.1.00.0090.00017.46
8.0.300.0020.00520.03
8.0.290.0040.00416.88
8.0.280.0040.00418.44
8.0.270.0030.00317.36
8.0.260.0050.00316.83
8.0.250.0000.00716.97
8.0.240.0040.00417.06
8.0.230.0000.00716.95
8.0.220.0050.00216.94
8.0.210.0070.00016.93
8.0.200.0060.00017.01
8.0.190.0000.00716.97
8.0.180.0080.00016.83
8.0.170.0030.00516.94
8.0.160.0000.00916.82
8.0.150.0100.00016.85
8.0.140.0030.00616.86
8.0.130.0000.00613.39
8.0.120.0000.00716.89
8.0.110.0000.00716.79
8.0.100.0080.00016.98
8.0.90.0000.00716.86
8.0.80.0070.01416.88
8.0.70.0000.00716.95
8.0.60.0050.00316.82
8.0.50.0000.00716.87
8.0.30.0110.00816.96
8.0.20.0100.00817.15
8.0.10.0050.00217.05
8.0.00.0130.01016.70
7.4.330.0000.00512.97
7.4.320.0000.00616.40
7.4.300.0060.00016.63
7.4.290.0000.00816.43
7.4.280.0060.00316.55
7.4.270.0030.00316.65
7.4.260.0030.00313.30
7.4.250.0040.00416.63
7.4.240.0000.00716.64
7.4.230.0040.00416.70
7.4.220.0050.01116.50
7.4.210.0050.01116.60
7.4.200.0070.00016.65
7.4.190.0030.00316.72
7.4.160.0120.00616.47
7.4.150.0090.00916.55
7.4.140.0160.00216.62
7.4.130.0090.01016.54
7.4.120.0120.00516.59
7.4.110.0030.01516.44
7.4.100.0070.01316.57
7.4.90.0040.01916.54
7.4.80.0090.00916.41
7.4.70.0070.01016.35
7.4.60.0110.01116.49
7.4.50.0050.00016.17
7.4.40.0040.00816.42
7.4.30.0050.01016.70
7.4.00.0100.00614.73
7.3.330.0030.00313.32
7.3.320.0030.00313.13
7.3.310.0000.00716.37
7.3.300.0000.00716.29
7.3.290.0070.00716.30
7.3.280.0070.01116.33
7.3.270.0080.01116.46
7.3.260.0150.00816.48
7.3.250.0120.00516.43
7.3.240.0090.00616.36
7.3.230.0060.01216.55
7.3.210.0120.00416.30
7.3.200.0150.00319.39
7.3.190.0090.01316.48
7.3.180.0130.00616.43
7.3.170.0060.00916.44
7.3.160.0080.00816.41
7.3.120.0070.00714.93
7.2.330.0090.00916.54
7.2.320.0060.01216.71
7.2.310.0120.00916.79
7.2.300.0070.01016.73
7.2.290.0100.00716.74
7.2.60.0070.00717.13
7.2.00.0000.01119.63
7.1.200.0030.01015.69
7.1.100.0040.00818.04
7.1.70.0000.01017.23
7.1.60.0110.01419.40
7.1.50.0140.01016.98
7.1.00.0000.07722.37
7.0.200.0000.00816.90
7.0.140.0030.07722.00
7.0.120.0070.05722.00
7.0.60.0100.04319.96
7.0.50.0130.03317.89
7.0.40.0100.05020.20
7.0.30.0170.08320.34
7.0.20.0230.03320.33
7.0.10.0130.08720.15
7.0.00.0070.06720.23
5.6.280.0000.07721.16
5.6.210.0100.07020.73
5.6.200.0070.04718.19
5.6.190.0070.04320.47
5.6.180.0270.04720.61
5.6.170.0330.07020.53
5.6.160.0070.07020.58
5.6.150.0170.05718.21
5.6.140.0030.04018.15
5.6.130.0070.03718.17
5.6.120.0030.04721.01
5.6.110.0100.08321.06
5.6.100.0170.07721.15
5.6.90.0070.08020.99
5.6.80.0030.04020.39
5.5.350.0170.04320.43
5.5.340.0000.04317.95
5.5.330.0070.08720.40
5.5.320.0230.08320.24
5.5.310.0300.05320.24
5.5.300.0000.09017.98
5.5.290.0030.04018.04
5.5.280.0100.08320.90
5.5.270.0170.07320.75
5.5.260.0070.09020.89
5.5.250.0070.03720.63
5.5.240.0100.07020.21
5.4.450.0030.05719.53
5.4.440.0030.04719.57
5.4.430.0000.05019.52
5.4.420.0200.06019.18
5.4.410.0030.04019.20
5.4.400.0070.05018.86
5.4.390.0070.08019.23
5.4.380.0070.04319.15
5.4.370.0070.03719.14
5.4.360.0000.05719.14
5.4.350.0070.07319.20
5.4.340.0030.06719.12
5.4.320.0000.06319.16
5.4.310.0130.07319.24
5.4.300.0070.05719.14
5.4.290.0030.06719.14
5.4.280.0030.04019.20
5.4.270.0070.07718.87
5.4.260.0070.04019.25
5.4.250.0070.03718.97
5.4.240.0070.04019.23
5.4.230.0170.04319.07
5.4.220.0070.08319.00
5.4.210.0100.07719.08
5.4.200.0130.05719.14
5.4.190.0000.06319.13
5.4.180.0100.06718.96
5.4.170.0130.07019.23
5.4.160.0070.06319.13
5.4.150.0130.07318.89
5.4.140.0130.06716.42
5.4.130.0070.07316.34
5.4.120.0200.06016.31
5.4.110.0070.06316.43
5.4.100.0170.06316.66
5.4.90.0000.07316.29
5.4.80.0130.06716.32
5.4.70.0030.06316.39
5.4.60.0070.07316.39
5.4.50.0000.05716.32
5.4.40.0130.05016.50
5.4.30.0030.07316.26
5.4.20.0070.05316.36
5.4.10.0100.04716.38
5.4.00.0070.04715.95
5.3.290.0070.04014.69
5.3.280.0030.07714.61
5.3.270.0130.07714.76
5.3.260.0100.07314.54
5.3.250.0070.07014.77
5.3.240.0100.07314.64
5.3.230.0100.07014.64
5.3.220.0070.07014.61
5.3.210.0130.07014.46
5.3.200.0100.05014.62
5.3.190.0000.04314.72
5.3.180.0070.04714.57
5.3.170.0070.07014.57
5.3.160.0070.07014.58
5.3.150.0100.06014.58
5.3.140.0000.04714.56
5.3.130.0000.06714.72
5.3.120.0100.05014.64
5.3.110.0100.03314.71
5.3.100.0000.07014.20
5.3.90.0100.06314.19
5.3.80.0030.06714.03
5.3.70.0200.05714.03
5.3.60.0070.05013.96
5.3.50.0100.07013.96
5.3.40.0130.04713.95
5.3.30.0100.06314.10
5.3.20.0070.06713.68
5.3.10.0070.06013.68
5.3.00.0070.07713.71
5.2.170.0070.05711.22
5.2.160.0100.06011.16
5.2.150.0130.04011.24
5.2.140.0000.06711.23
5.2.130.0030.05011.27
5.2.120.0000.05011.19
5.2.110.0100.03711.11
5.2.100.0130.04711.09
5.2.90.0100.04311.28
5.2.80.0070.05311.16
5.2.70.0070.03711.17
5.2.60.0000.05311.02
5.2.50.0100.06310.95
5.2.40.0030.04710.95
5.2.30.0000.06710.91
5.2.20.0070.04310.89
5.2.10.0000.03011.03
5.2.00.0000.03010.63
5.1.60.0030.05710.08
5.1.50.0000.04010.01
5.1.40.0070.0209.96
5.1.30.0030.02310.35
5.1.20.0030.02310.38
5.1.10.0000.02710.08
5.1.00.0030.03010.24
5.0.50.0000.0208.54
5.0.40.0000.0208.34
5.0.30.0030.0338.29
5.0.20.0000.0208.28
5.0.10.0000.0208.09
5.0.00.0000.0308.10
4.4.90.0030.0378.01
4.4.80.0070.0308.01
4.4.70.0000.0208.01
4.4.60.0030.0308.01
4.4.50.0030.0278.01
4.4.40.0070.0478.01
4.4.30.0000.0178.01
4.4.20.0000.0178.01
4.4.10.0030.0138.01
4.4.00.0000.0238.01
4.3.110.0000.0178.01
4.3.100.0000.0178.01
4.3.90.0000.0138.01
4.3.80.0030.0238.01
4.3.70.0030.0138.01
4.3.60.0000.0138.01
4.3.50.0000.0178.01
4.3.40.0030.0208.01
4.3.30.0030.0138.01
4.3.20.0030.0138.01
4.3.10.0000.0138.01
4.3.00.0000.0138.01

preferences:
36.49 ms | 401 KiB | 5 Q