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 '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.0090.00616.63
8.3.50.0110.00822.10
8.3.40.0070.00718.86
8.3.30.0110.00619.18
8.3.20.0040.00420.16
8.3.10.0040.00423.66
8.3.00.0050.00319.13
8.2.180.0040.01118.55
8.2.170.0120.00422.96
8.2.160.0030.01020.37
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0080.00019.51
8.2.110.0090.00019.34
8.2.100.0070.00719.03
8.2.90.0030.00517.75
8.2.80.0040.00417.97
8.2.70.0040.00417.93
8.2.60.0000.00817.93
8.2.50.0080.00018.10
8.2.40.0000.00822.27
8.2.30.0040.00418.16
8.2.20.0000.00817.78
8.2.10.0050.00317.91
8.2.00.0040.00417.51
8.1.280.0030.01025.92
8.1.270.0040.00422.10
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0000.00922.14
8.1.230.0090.00319.09
8.1.220.0050.00417.74
8.1.210.0060.00318.77
8.1.200.0110.00017.38
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0000.00918.46
8.1.160.0050.00221.95
8.1.150.0030.00518.56
8.1.140.0000.00817.38
8.1.130.0070.00017.85
8.1.120.0000.00717.47
8.1.110.0000.00817.36
8.1.100.0000.00717.32
8.1.90.0040.00417.43
8.1.80.0040.00417.46
8.1.70.0070.00017.32
8.1.60.0050.00517.56
8.1.50.0040.00417.49
8.1.40.0030.00517.36
8.1.30.0040.00717.50
8.1.20.0050.00317.65
8.1.10.0080.00017.59
8.1.00.0000.00817.54
8.0.300.0040.00419.68
8.0.290.0090.00016.75
8.0.280.0030.00318.48
8.0.270.0050.00317.29
8.0.260.0000.00617.20
8.0.250.0030.00316.99
8.0.240.0040.00416.88
8.0.230.0000.00816.96
8.0.220.0000.00716.87
8.0.210.0050.00316.73
8.0.200.0040.00416.81
8.0.190.0000.00716.88
8.0.180.0000.00816.88
8.0.170.0040.00416.77
8.0.160.0000.00816.83
8.0.150.0000.00816.93
8.0.140.0070.00016.84
8.0.130.0050.00013.25
8.0.120.0000.00816.72
8.0.110.0000.00716.90
8.0.100.0100.00016.76
8.0.90.0040.00416.77
8.0.80.0090.00616.77
8.0.70.0080.00016.97
8.0.60.0040.00416.73
8.0.50.0050.00316.69
8.0.30.0140.00517.18
8.0.20.0100.00917.40
8.0.10.0040.00416.92
8.0.00.0140.00516.74
7.4.330.0020.00215.08
7.4.320.0030.00316.61
7.4.300.0030.00316.61
7.4.290.0070.00016.46
7.4.280.0070.00016.45
7.4.270.0040.00416.45
7.4.260.0000.00716.35
7.4.250.0000.00716.34
7.4.240.0000.00716.40
7.4.230.0000.00716.57
7.4.220.0030.01616.61
7.4.210.0100.00716.47
7.4.200.0040.00416.46
7.4.190.0000.00716.66
7.4.160.0090.01316.61
7.4.150.0120.00617.40
7.4.140.0080.01217.86
7.4.130.0070.01016.39
7.4.120.0100.01116.45
7.4.110.0070.01416.57
7.4.100.0070.01116.34
7.4.90.0110.00716.55
7.4.80.0110.01219.39
7.4.70.0070.01016.46
7.4.60.0170.00616.39
7.4.50.0000.00416.64
7.4.40.0070.01016.52
7.4.30.0040.01216.41
7.4.00.0080.00715.02
7.3.330.0050.00013.13
7.3.320.0000.00513.08
7.3.310.0030.00516.25
7.3.300.0030.00416.27
7.3.290.0080.00616.27
7.3.280.0060.01316.26
7.3.270.0130.00717.40
7.3.260.0160.00716.27
7.3.250.0140.00616.41
7.3.240.0040.01316.50
7.3.230.0160.00516.46
7.3.210.0100.00616.38
7.3.200.0060.01119.39
7.3.190.0110.00816.23
7.3.180.0060.00916.41
7.3.170.0160.00716.44
7.3.160.0120.00416.54
7.3.120.0110.00614.74
7.3.110.0090.00914.96
7.3.100.0130.00314.80
7.3.90.0040.01114.89
7.3.80.0060.00814.71
7.3.70.0100.00714.47
7.3.60.0060.01014.52
7.3.50.0030.01414.84
7.3.40.0100.01014.39
7.3.30.0120.00314.62
7.3.20.0070.00416.54
7.3.10.0070.00616.65
7.3.00.0060.00816.53
7.2.330.0030.01416.51
7.2.320.0120.01216.73
7.2.310.0070.01016.36
7.2.300.0130.00416.76
7.2.290.0090.00616.51
7.2.250.0040.01615.22
7.2.240.0070.01015.27
7.2.230.0040.01414.74
7.2.220.0100.00715.00
7.2.210.0000.01315.15
7.2.200.0030.01014.98
7.2.190.0100.01015.23
7.2.180.0030.01615.23
7.2.170.0050.00515.09
7.2.130.0000.01017.00
7.2.120.0040.01116.88
7.2.110.0090.00616.97
7.2.100.0060.00617.05
7.2.90.0060.00616.89
7.2.80.0030.01016.57
7.2.70.0070.00717.14
7.2.60.0090.00617.04
7.2.50.0090.00816.52
7.2.40.0060.00616.91
7.2.30.0090.00617.11
7.2.20.0040.00717.00
7.2.10.0070.01017.01
7.2.00.0090.00616.73
7.1.330.0080.00816.02
7.1.320.0100.00715.61
7.1.310.0000.01715.73
7.1.300.0100.01015.95
7.1.290.0090.00915.75
7.1.280.0080.00815.60
7.1.270.0000.01315.50
7.1.260.0030.01015.98
7.1.250.0060.00615.70
7.1.70.0110.00317.05
7.1.60.0110.00817.34
7.1.50.0070.01816.86
7.1.00.0100.07022.48
7.0.200.0060.00916.79
7.0.140.0070.07022.00
7.0.60.0300.07019.95
7.0.50.0070.08017.97
7.0.40.0170.07320.30
7.0.30.0330.08020.06
7.0.20.0430.07020.15
7.0.10.0000.04720.25
7.0.00.0070.08320.07
5.6.280.0070.07021.14
5.6.210.0170.06320.63
5.6.200.0130.08318.14
5.6.190.0070.07720.45
5.6.180.0270.07320.64
5.6.170.0270.04720.47
5.6.160.0030.05720.49
5.6.150.0030.06018.24
5.6.140.0130.04018.21
5.6.130.0070.07718.28
5.6.120.0100.09021.15
5.6.110.0000.07021.01
5.6.100.0070.08321.02
5.6.90.0100.08020.89
5.6.80.0130.06720.45
5.5.350.0030.03020.42
5.5.340.0070.08318.08
5.5.330.0070.04020.42
5.5.320.0470.04720.26
5.5.310.0230.07320.34
5.5.300.0030.03717.97
5.5.290.0130.06317.95
5.5.280.0100.03720.89
5.5.270.0030.04320.95
5.5.260.0130.08020.68
5.5.250.0000.04320.68
5.5.240.0070.05320.20
5.4.450.0600.04719.55
5.4.440.0600.04319.63
5.4.430.0170.04719.15
5.4.420.1000.03019.48
5.4.410.0830.04719.05
5.4.400.0830.03019.22
5.4.390.1000.03319.31
5.4.380.0800.03019.09
5.4.370.0570.04319.16
5.4.360.0530.03719.16
5.4.350.0430.04019.20
5.4.340.0200.03019.06
5.4.320.0600.04319.17
5.4.310.0400.04719.16
5.4.300.0530.04318.82
5.4.290.0270.04018.99
5.4.280.0730.04019.21
5.4.270.0730.03719.21
5.4.260.0630.04319.05
5.4.250.0430.05019.05
5.4.240.0500.04319.21
5.4.230.0370.04319.21
5.4.220.0630.03719.04
5.4.210.0500.04019.05
5.4.200.0600.04019.05
5.4.190.0270.04319.02
5.4.180.0600.03019.11
5.4.170.0900.04319.12
5.4.160.0770.03019.10
5.4.150.1000.02719.17
5.4.140.0900.03316.30
5.4.130.0500.04016.52
5.4.120.0230.04716.32
5.4.110.0530.03016.25
5.4.100.0770.03716.52
5.4.90.0770.03716.45
5.4.80.0500.03716.32
5.4.70.0870.03316.50
5.4.60.0530.03316.32
5.4.50.0400.03716.45
5.4.40.0370.03016.31
5.4.30.0830.03316.55
5.4.20.0630.04016.51
5.4.10.0500.04316.34
5.4.00.0430.02716.01
5.3.290.0670.03316.01
5.3.280.0500.04716.01
5.3.270.0700.03716.01
5.3.260.0730.04016.01
5.3.250.0870.03716.01
5.3.240.0730.04016.01
5.3.230.0500.03716.01
5.3.220.0570.03016.01
5.3.210.0230.04316.01
5.3.200.0970.02716.01
5.3.190.0700.03716.01
5.3.180.0770.03316.01
5.3.170.0630.04316.01
5.3.160.0200.03716.01
5.3.150.0630.02716.01
5.3.140.0730.03316.01
5.3.130.0400.04016.01
5.3.120.0470.04716.01
5.3.110.0370.05016.01
5.3.100.0330.03716.01
5.3.90.0400.04316.01
5.3.80.0670.04016.01
5.3.70.0800.04016.01
5.3.60.0670.02716.01
5.3.50.0330.03316.01
5.3.40.0300.03716.01
5.3.30.0230.04716.01
5.3.20.0730.03316.01
5.3.10.0830.04016.01
5.3.00.0470.03716.01
5.2.170.0500.03716.01
5.2.160.0530.03016.01
5.2.150.0570.03316.01
5.2.140.0300.03716.01
5.2.130.0730.02316.01
5.2.120.0430.03716.01
5.2.110.0500.02716.01
5.2.100.0530.03716.01
5.2.90.0500.02716.01
5.2.80.0600.03316.01
5.2.70.0770.03016.01
5.2.60.0470.02016.01
5.2.50.0370.03716.01
5.2.40.0300.04316.01
5.2.30.0400.03016.01
5.2.20.0170.03316.01
5.2.10.0030.03016.01
5.2.00.0630.02316.01
5.1.60.0530.03016.01
5.1.50.0330.02716.01
5.1.40.0600.02316.01
5.1.30.0170.02716.01
5.1.20.0170.02716.01
5.1.10.0370.02716.01
5.1.00.0170.02716.01
5.0.50.0200.01716.01
5.0.40.0400.02016.01
5.0.30.0200.03716.01
5.0.20.0370.01316.01
5.0.10.0200.02016.01
5.0.00.0170.03316.01
4.4.90.0270.02016.01
4.4.80.0200.02716.01
4.4.70.0100.01716.01
4.4.60.0430.01016.01
4.4.50.0070.01016.01
4.4.40.0200.02716.01
4.4.30.0100.01716.01
4.4.20.0100.02016.01
4.4.10.0100.02016.01
4.4.00.0200.02316.01
4.3.110.0230.02016.01
4.3.100.0130.02016.01
4.3.90.0030.01316.01
4.3.80.0100.03316.01
4.3.70.0230.02016.01
4.3.60.0330.00716.01
4.3.50.0200.01316.01
4.3.40.0130.03316.01
4.3.30.0000.02016.01
4.3.20.0130.01716.01
4.3.10.0100.02316.01
4.3.00.0130.01316.01

preferences:
42.68 ms | 400 KiB | 5 Q