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(); } 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.0120.00916.75
8.3.50.0110.00722.04
8.3.40.0070.01418.88
8.3.30.0050.01019.05
8.3.20.0000.00920.21
8.3.10.0080.00023.66
8.3.00.0080.00020.95
8.2.180.0110.00418.48
8.2.170.0150.00622.96
8.2.160.0110.00420.41
8.2.150.0040.00424.18
8.2.140.0060.01224.66
8.2.130.0050.00226.16
8.2.120.0030.01220.57
8.2.110.0030.00622.20
8.2.100.0040.00717.72
8.2.90.0040.00419.05
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0080.00018.04
8.2.50.0040.00418.07
8.2.40.0080.00021.10
8.2.30.0070.00018.28
8.2.20.0070.00017.70
8.2.10.0040.00418.07
8.2.00.0030.00617.71
8.1.280.0030.01425.92
8.1.270.0030.00523.82
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0100.01023.83
8.1.230.0080.00319.23
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00617.35
8.1.190.0080.00017.35
8.1.180.0030.00618.10
8.1.170.0090.00018.34
8.1.160.0030.00522.06
8.1.150.0040.00418.59
8.1.140.0040.00417.47
8.1.130.0000.00717.82
8.1.120.0030.00417.49
8.1.110.0000.00717.25
8.1.100.0070.00017.31
8.1.90.0000.00717.45
8.1.80.0040.00417.48
8.1.70.0000.00717.39
8.1.60.0030.00517.49
8.1.50.0050.00317.44
8.1.40.0040.00417.40
8.1.30.0000.00817.62
8.1.20.0040.00417.63
8.1.10.0000.00917.62
8.1.00.0080.00017.43
8.0.300.0020.00518.77
8.0.290.0020.00517.30
8.0.280.0000.00718.40
8.0.270.0070.00017.26
8.0.260.0030.00617.29
8.0.250.0080.00017.03
8.0.240.0040.00416.95
8.0.230.0000.00716.89
8.0.220.0000.00716.84
8.0.210.0070.00016.86
8.0.200.0030.00316.83
8.0.190.0000.00816.76
8.0.180.0000.00816.94
8.0.170.0020.00516.90
8.0.160.0000.00716.87
8.0.150.0040.00416.82
8.0.140.0000.00716.82
8.0.130.0000.00613.27
8.0.120.0080.00016.83
8.0.110.0030.00516.89
8.0.100.0050.00216.67
8.0.90.0050.00216.92
8.0.80.0130.01016.86
8.0.70.0000.00716.73
8.0.60.0040.00416.82
8.0.50.0080.00016.75
8.0.30.0100.00917.02
8.0.20.0080.01117.40
8.0.10.0040.00416.93
8.0.00.0130.00416.72
7.4.330.0040.00415.00
7.4.320.0040.00416.46
7.4.300.0030.00316.45
7.4.290.0000.00716.41
7.4.280.0030.00316.52
7.4.270.0090.00016.62
7.4.260.0000.00716.55
7.4.250.0040.00416.51
7.4.240.0000.00716.51
7.4.230.0000.00716.45
7.4.220.0190.00616.63
7.4.210.0030.01316.55
7.4.200.0050.00216.64
7.4.190.0030.00416.57
7.4.160.0130.00316.34
7.4.150.0130.00417.40
7.4.140.0090.01117.86
7.4.130.0100.00616.44
7.4.120.0060.01216.31
7.4.110.0120.00616.57
7.4.100.0160.00816.47
7.4.90.0090.01516.27
7.4.80.0040.01519.39
7.4.70.0160.00616.54
7.4.60.0100.00716.49
7.4.50.0030.00616.29
7.4.40.0060.01216.39
7.4.30.0070.01016.51
7.4.00.0000.01514.94
7.3.330.0060.00013.28
7.3.320.0000.00713.12
7.3.310.0040.00416.30
7.3.300.0030.00316.27
7.3.290.0110.00416.16
7.3.280.0060.01216.26
7.3.270.0120.01217.40
7.3.260.0130.00416.46
7.3.250.0130.00616.54
7.3.240.0140.01016.43
7.3.230.0100.00716.59
7.3.210.0140.00316.42
7.3.200.0060.01319.39
7.3.190.0090.00916.34
7.3.180.0060.01016.34
7.3.170.0080.00816.33
7.3.160.0100.00716.55
7.3.120.0070.00914.96
7.3.110.0060.01214.93
7.3.100.0070.00715.05
7.3.90.0070.00314.93
7.3.80.0100.01014.88
7.3.70.0060.01214.53
7.3.60.0090.00614.75
7.3.50.0070.01014.86
7.3.40.0000.01014.84
7.3.30.0100.00314.93
7.3.20.0080.00816.48
7.3.10.0040.01116.52
7.3.00.0030.00616.78
7.2.330.0090.00916.86
7.2.320.0150.00316.59
7.2.310.0100.01016.79
7.2.300.0030.01416.66
7.2.290.0090.00916.78
7.2.250.0110.00714.74
7.2.240.0110.00815.33
7.2.230.0090.00614.89
7.2.220.0090.00315.11
7.2.210.0030.01414.88
7.2.200.0060.01014.99
7.2.190.0000.01615.22
7.2.180.0000.01415.08
7.2.170.0100.00315.09
7.2.60.0070.00716.96
7.2.00.0000.01219.49
7.1.330.0000.01315.73
7.1.320.0000.01315.61
7.1.310.0030.00915.55
7.1.300.0030.01415.78
7.1.290.0000.01015.91
7.1.280.0070.00715.83
7.1.270.0090.00315.76
7.1.260.0070.00315.92
7.1.200.0000.01515.53
7.1.100.0060.00317.93
7.1.70.0030.00317.02
7.1.60.0110.01119.46
7.1.50.0130.01016.99
7.1.00.0030.07722.48
7.0.200.0030.00616.61
7.0.140.0070.07022.12
7.0.60.0000.05319.95
7.0.50.0070.05317.92
7.0.40.0130.06320.23
7.0.30.0270.08720.06
7.0.20.0400.04020.30
7.0.10.0030.06720.02
7.0.00.0070.06720.06
5.6.280.0030.07721.11
5.6.210.0070.07720.56
5.6.200.0030.06318.20
5.6.190.0100.03720.67
5.6.180.0170.04020.68
5.6.170.0200.08320.43
5.6.160.0100.04020.59
5.6.150.0130.07718.24
5.6.140.0130.06318.18
5.6.130.0070.07718.28
5.6.120.0100.06321.03
5.6.110.0100.08321.06
5.6.100.0070.05721.12
5.6.90.0070.08320.98
5.6.80.0070.05720.52
5.5.350.4070.03720.36
5.5.340.0100.04017.94
5.5.330.0030.08720.40
5.5.320.0300.04320.34
5.5.310.0230.06020.29
5.5.300.0030.04017.99
5.5.290.0070.07317.97
5.5.280.0030.04320.89
5.5.270.0030.08020.88
5.5.260.0170.05320.74
5.5.250.0100.05320.63
5.5.240.0100.07320.20
5.4.450.0330.05719.64
5.4.440.0370.04319.49
5.4.430.0200.06719.58
5.4.420.0300.07319.45
5.4.410.0370.07019.33
5.4.400.0270.05718.86
5.4.390.0230.04719.00
5.4.380.0300.06319.15
5.4.370.0330.06719.22
5.4.360.0330.03719.31
5.4.350.0270.06019.27
5.4.340.0300.04019.24
5.4.320.0370.05718.87
5.4.310.0370.03718.98
5.4.300.0300.07318.84
5.4.290.0330.04019.16
5.4.280.0300.08019.22
5.4.270.0300.04019.08
5.4.260.0230.05019.24
5.4.250.0400.03718.95
5.4.240.0330.07019.15
5.4.230.0300.06719.07
5.4.220.0370.06318.97
5.4.210.0470.03719.21
5.4.200.0270.04718.84
5.4.190.0370.06018.94
5.4.180.0300.05719.23
5.4.170.0270.07719.18
5.4.160.0270.04719.04
5.4.150.0300.03319.22
5.4.140.0300.06016.36
5.4.130.0300.05016.34
5.4.120.0430.03316.38
5.4.110.0230.04716.28
5.4.100.0400.05316.51
5.4.90.0270.05016.36
5.4.80.0330.04016.39
5.4.70.0270.07716.18
5.4.60.0370.05316.33
5.4.50.0270.06716.52
5.4.40.0270.04316.53
5.4.30.0230.04316.53
5.4.20.0330.06316.53
5.4.10.0270.04016.24
5.4.00.0400.03015.79
5.3.290.0270.05014.66
5.3.280.0270.03714.69
5.3.270.0300.03314.70
5.3.260.0300.07014.69
5.3.250.0300.07314.73
5.3.240.0300.07014.64
5.3.230.0330.06714.54
5.3.220.0230.04314.68
5.3.210.0270.06314.48
5.3.200.0330.06314.66
5.3.190.0230.07714.55
5.3.180.0330.06014.59
5.3.170.0270.07714.66
5.3.160.0370.06314.48
5.3.150.0300.06714.58
5.3.140.0400.06714.57
5.3.130.0430.06014.48
5.3.120.0330.06714.63
5.3.110.0300.06014.78
5.3.100.0270.07014.07
5.3.90.0230.03713.95
5.3.80.0230.05713.96
5.3.70.0230.04013.94
5.3.60.0300.05714.23
5.3.50.0370.06313.97
5.3.40.0300.06014.04
5.3.30.0230.05713.93
5.3.20.0300.06013.93
5.3.10.0330.06313.68
5.3.00.0400.05713.55
5.2.170.0230.04011.82
5.2.160.0330.04311.82
5.2.150.0300.05311.82
5.2.140.0270.04311.82
5.2.130.0330.05011.82
5.2.120.0300.02711.82
5.2.110.0270.05711.82
5.2.100.0230.06011.82
5.2.90.0230.05311.82
5.2.80.0300.04711.82
5.2.70.0230.03711.82
5.2.60.0300.03011.82
5.2.50.0300.03011.82
5.2.40.0130.06011.82
5.2.30.0200.05711.82
5.2.20.0200.06011.82
5.2.10.0200.07011.82
5.2.00.0230.04011.82
5.1.60.0170.03711.82
5.1.50.0170.03011.82
5.1.40.0130.03011.82
5.1.30.0270.02311.82
5.1.20.0200.03311.82
5.1.10.0200.05011.82
5.1.00.0200.03011.82
5.0.50.0070.02311.82
5.0.40.0100.03311.82
5.0.30.0030.04311.82
5.0.20.0070.02711.82
5.0.10.0070.03011.82
5.0.00.0070.03711.82
4.4.90.0130.03311.82
4.4.80.0070.04311.82
4.4.70.0100.02711.82
4.4.60.0130.02711.82
4.4.50.0130.03311.82
4.4.40.0070.03011.82
4.4.30.0070.02711.82
4.4.20.0070.01711.82
4.4.10.0070.02011.82
4.4.00.0100.02311.82
4.3.110.0030.02711.82
4.3.100.0100.02011.82
4.3.90.0130.02311.82
4.3.80.0100.02311.82
4.3.70.0130.01011.82
4.3.60.0030.02011.82
4.3.50.0070.01711.82
4.3.40.0070.02311.82
4.3.30.0030.01711.82
4.3.20.0030.01311.82
4.3.10.0070.01311.82
4.3.00.0000.01711.82

preferences:
42.26 ms | 401 KiB | 5 Q