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 \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)
8.3.60.0040.01118.29
8.3.50.0080.00918.40
8.3.40.0090.00618.80
8.3.30.0090.00618.84
8.3.20.0060.01018.65
8.3.10.0100.00020.52
8.3.00.0090.00019.25
8.2.180.0150.00016.50
8.2.170.0120.00322.96
8.2.160.0100.00618.92
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00721.03
8.2.110.0040.01421.06
8.2.100.0070.00319.38
8.2.90.0030.00617.63
8.2.80.0060.00318.79
8.2.70.0090.00017.75
8.2.60.0050.00317.50
8.2.50.0040.00417.63
8.2.40.0000.00918.16
8.2.30.0000.00817.95
8.2.20.0030.00617.59
8.2.10.0080.00017.64
8.2.00.0030.00617.53
8.1.280.0200.00325.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.01
8.1.230.0090.00319.24
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0090.00017.35
8.1.190.0030.00517.35
8.1.180.0000.00918.10
8.1.170.0000.00818.96
8.1.160.0030.00518.92
8.1.150.0000.01018.68
8.1.140.0040.00417.49
8.1.130.0030.00317.78
8.1.120.0000.00717.39
8.1.110.0050.00217.46
8.1.100.0040.00417.55
8.1.90.0030.00617.41
8.1.80.0070.00017.43
8.1.70.0000.00717.39
8.1.60.0040.00417.47
8.1.50.0000.00717.52
8.1.40.0000.00817.52
8.1.30.0040.00417.67
8.1.20.0040.00417.74
8.1.10.0000.00817.59
8.1.00.0080.00017.55
8.0.300.0000.00719.60
8.0.290.0020.00516.75
8.0.280.0000.00718.56
8.0.270.0000.00717.16
8.0.260.0000.00816.73
8.0.250.0000.00716.88
8.0.240.0000.00817.02
8.0.230.0080.00016.98
8.0.220.0040.00416.87
8.0.210.0030.00316.82
8.0.200.0030.00316.85
8.0.190.0080.00016.99
8.0.180.0000.00716.93
8.0.170.0060.00316.86
8.0.160.0080.00016.89
8.0.150.0000.00716.85
8.0.140.0080.00016.77
8.0.130.0060.00013.33
8.0.120.0040.00416.84
8.0.110.0000.00716.75
8.0.100.0080.00016.68
8.0.90.0040.00416.98
8.0.80.0060.00916.84
8.0.70.0030.00516.97
8.0.60.0000.00916.73
8.0.50.0050.00316.75
8.0.30.0120.00917.10
8.0.20.0080.01017.17
8.0.10.0030.00517.03
8.0.00.0110.01116.78
7.4.330.0020.00312.95
7.4.320.0060.00016.55
7.4.300.0040.00416.54
7.4.290.0030.00316.46
7.4.280.0030.00616.53
7.4.270.0000.00716.63
7.4.260.0030.00313.36
7.4.250.0000.00816.54
7.4.240.0040.00316.63
7.4.230.0030.00316.54
7.4.220.0090.01216.60
7.4.210.0140.00616.41
7.4.200.0000.00816.45
7.4.190.0070.00016.67
7.4.160.0110.00616.50
7.4.150.0140.00616.52
7.4.140.0140.00516.49
7.4.130.0110.00716.52
7.4.120.0140.00316.36
7.4.110.0100.00716.55
7.4.100.0120.01216.55
7.4.90.0160.01016.73
7.4.80.0060.01019.39
7.4.70.0070.01016.55
7.4.60.0090.00616.47
7.4.50.0040.00416.44
7.4.40.0060.00616.55
7.4.30.0160.00316.43
7.4.10.0060.00915.15
7.4.00.0080.00815.02
7.3.330.0060.00013.32
7.3.320.0070.00013.20
7.3.310.0030.00316.43
7.3.300.0040.00416.34
7.3.290.0080.00716.29
7.3.280.0050.01416.30
7.3.270.0060.01116.27
7.3.260.0060.01216.52
7.3.250.0110.01316.58
7.3.240.0070.01516.40
7.3.230.0110.00716.33
7.3.210.0130.00716.42
7.3.200.0100.01016.34
7.3.190.0130.01016.59
7.3.180.0110.00716.48
7.3.170.0110.00416.18
7.3.160.0120.00616.37
7.3.130.0000.01014.70
7.3.120.0050.01115.01
7.3.110.0110.00614.50
7.3.100.0070.00714.70
7.3.90.0000.01315.04
7.3.80.0070.00414.77
7.3.70.0100.00314.76
7.3.60.0080.00814.92
7.3.50.0000.01614.54
7.3.40.0030.01314.80
7.3.30.0030.00614.76
7.3.20.0040.01116.75
7.3.10.0100.00016.71
7.3.00.0070.00416.79
7.2.330.0030.01316.64
7.2.320.0170.00916.83
7.2.310.0030.02016.58
7.2.300.0060.01216.61
7.2.290.0070.01016.58
7.2.260.0100.00714.96
7.2.250.0060.01215.08
7.2.240.0030.00914.98
7.2.230.0130.00315.32
7.2.220.0030.00615.31
7.2.210.0000.01214.92
7.2.200.0000.01014.84
7.2.190.0090.00915.18
7.2.180.0030.00915.16
7.2.170.0110.00315.12
7.2.160.0060.00315.18
7.2.150.0090.00616.81
7.2.140.0070.00716.82
7.2.130.0030.01017.09
7.2.120.0080.00716.77
7.2.110.0070.00816.64
7.2.100.0200.00516.77
7.2.90.0150.00616.72
7.2.80.0200.00416.77
7.2.70.0100.00916.93
7.2.60.0120.00616.83
7.2.50.0240.00517.00
7.2.40.0190.00616.81
7.2.30.0160.00716.87
7.2.20.0170.00616.86
7.2.10.0130.00516.84
7.2.00.0140.01017.36
7.1.330.0040.01116.02
7.1.320.0070.01015.79
7.1.310.0070.00715.74
7.1.300.0090.00615.74
7.1.290.0030.01315.75
7.1.280.0060.00615.77
7.1.270.0060.00915.74
7.1.260.0070.00715.83
7.1.250.0030.01015.90
7.1.240.1170.01115.90
7.1.230.0110.00415.75
7.1.220.0090.00715.50
7.1.210.0210.00515.62
7.1.200.0140.00615.73
7.1.190.0150.00715.72
7.1.180.0160.00615.64
7.1.170.0110.00615.63
7.1.160.0150.00615.78
7.1.150.0110.00715.79
7.1.140.0160.00315.68
7.1.130.0200.00515.76
7.1.120.0180.00315.59
7.1.110.0130.01015.79
7.1.100.0090.00716.39
7.1.90.0150.00715.73
7.1.80.0260.00615.85
7.1.70.0120.00916.14
7.1.60.0140.00916.67
7.1.50.0220.00816.13
7.1.40.0190.00415.66
7.1.30.0250.00515.75
7.1.20.0180.00515.68
7.1.10.0130.00815.64
7.1.00.0240.01717.33
7.0.330.0120.00315.48
7.0.320.0210.00315.51
7.0.310.0210.00315.29
7.0.300.0160.00815.42
7.0.290.0110.00715.37
7.0.280.0180.00115.31
7.0.270.0170.00215.29
7.0.260.0120.01015.38
7.0.250.0140.00715.49
7.0.240.0330.00715.44
7.0.230.0290.00315.47
7.0.220.0240.00615.40
7.0.210.0120.00415.33
7.0.200.0180.00515.72
7.0.190.0230.00715.27
7.0.180.0190.00315.49
7.0.170.0140.00615.56
7.0.160.0210.01015.37
7.0.150.0230.00415.43
7.0.140.0100.02517.00
7.0.130.0130.00915.39
7.0.120.0170.01817.11
7.0.110.0150.00715.36
7.0.100.0080.00915.40
7.0.90.0180.00515.24
7.0.80.0150.00815.34
7.0.70.0160.00715.32
7.0.60.0170.02316.56
7.0.50.0160.01416.04
7.0.40.0100.01515.10
7.0.30.0150.02314.98
7.0.20.0130.02615.15
7.0.10.0070.02315.19
7.0.00.0050.02915.12
5.6.400.0140.00014.53
5.6.390.0030.01014.26
5.6.380.0100.00514.64
5.6.370.0060.00914.49
5.6.360.0080.01114.42
5.6.350.0110.00514.60
5.6.340.0100.00514.47
5.6.330.0110.00514.29
5.6.320.0130.00414.63
5.6.310.0100.00414.43
5.6.300.0090.00514.43
5.6.290.0050.01014.42
5.6.280.0070.02616.12
5.6.270.0070.00914.32
5.6.260.0070.00614.31
5.6.250.0090.00614.51
5.6.240.0080.00714.51
5.6.230.0090.00914.45
5.6.220.0110.00614.41
5.6.210.0070.01716.07
5.6.200.0080.02715.22
5.6.190.0080.02415.87
5.6.180.0120.01515.86
5.6.170.0150.02115.89
5.6.160.0070.02815.82
5.6.150.0080.02315.37
5.6.140.0100.01115.34
5.6.130.0070.01415.29
5.6.120.0120.01916.11
5.6.110.0070.02616.03
5.6.100.0090.02216.09
5.6.90.0080.02516.06
5.6.80.0050.02715.88
5.6.70.0080.00314.31
5.6.60.0090.00514.33
5.6.50.0060.00914.22
5.6.40.0100.00614.45
5.6.30.0100.00614.40
5.6.20.0070.00814.39
5.6.10.0060.00714.40
5.6.00.0100.00614.28
5.5.380.0050.00812.79
5.5.370.0060.00612.87
5.5.360.0090.00512.78
5.5.350.0060.02014.77
5.5.340.0050.02214.17
5.5.330.0080.02414.69
5.5.320.0410.01914.76
5.5.310.0120.02214.67
5.5.300.0050.02614.09
5.5.290.0060.02714.11
5.5.280.0050.02514.76
5.5.270.0090.02414.82
5.5.260.0050.02314.90
5.5.250.0070.01214.73
5.5.240.0120.02114.62
5.5.230.0090.00312.71
5.5.220.0050.00512.75
5.5.210.0090.00412.81
5.5.200.0060.00712.63
5.5.190.0060.00612.71
5.5.180.0090.00312.69
5.5.170.0090.00614.44
5.5.160.0090.00512.85
5.5.150.0050.00712.87
5.5.140.0070.00712.73
5.5.130.0060.00712.79
5.5.120.0070.00612.81
5.5.110.0060.00612.90
5.5.100.0060.00612.73
5.5.90.0030.00712.88
5.5.80.0060.00712.76
5.5.70.0060.00812.79
5.5.60.0050.00712.79
5.5.50.0090.00412.60
5.5.40.0090.00512.76
5.5.30.0040.00712.78
5.5.20.0080.00412.68
5.5.10.0040.00712.76
5.5.00.0090.00512.79
5.4.450.0240.01315.31
5.4.440.0160.01415.31
5.4.430.0240.01115.31
5.4.420.0220.01315.31
5.4.410.0160.01715.31
5.4.400.0170.01015.38
5.4.390.0130.01615.31
5.4.380.0140.01415.38
5.4.370.0120.01215.33
5.4.360.0160.01215.31
5.4.350.0250.01315.32
5.4.340.0120.01515.34
5.4.330.0030.00712.12
5.4.320.0150.01615.31
5.4.310.0110.01315.36
5.4.300.0130.01615.32
5.4.290.0130.01315.31
5.4.280.0160.01415.31
5.4.270.0170.01415.36
5.4.260.0130.01315.31
5.4.250.0130.01715.31
5.4.240.0110.01515.37
5.4.230.0200.01215.31
5.4.220.0240.01215.36
5.4.210.0190.01315.31
5.4.200.0130.01315.31
5.4.190.0170.01215.31
5.4.180.0110.01515.31
5.4.170.0250.01414.48
5.4.160.0170.01314.51
5.4.150.0150.01314.48
5.4.140.0140.01414.48
5.4.130.0180.01214.59
5.4.120.0170.01414.58
5.4.110.0170.01614.55
5.4.100.0130.01514.51
5.4.90.0220.01314.48
5.4.80.0190.01514.48
5.4.70.0260.01614.53
5.4.60.0090.01314.48
5.4.50.0170.01114.48
5.4.40.0120.01414.51
5.4.30.0110.01514.50
5.4.20.0130.01514.55
5.4.10.0180.01714.50
5.4.00.0150.01414.51
5.3.290.0120.01615.31
5.3.280.0140.01315.31
5.3.270.0220.01214.78
5.3.260.0170.01514.48
5.3.250.0190.01514.48
5.3.240.0150.01514.48
5.3.230.0080.01514.48
5.3.220.0180.01114.48
5.3.210.0120.01314.48
5.3.200.0120.01314.48
5.3.190.0270.01114.48
5.3.180.0130.00914.48
5.3.170.0110.01614.48
5.3.160.0210.01214.48
5.3.150.0140.01514.48
5.3.140.0170.01314.48
5.3.130.0180.01114.48
5.3.120.0100.01514.48
5.3.110.0190.01414.48
5.3.100.0150.01314.48
5.3.90.0180.01514.48
5.3.80.0110.01514.48
5.3.70.0180.01214.48
5.3.60.0180.01314.48
5.3.50.0260.01114.48
5.3.40.0140.01414.48
5.3.30.0170.01014.48
5.3.20.0160.01014.48
5.3.10.0140.01414.48
5.3.00.0150.01314.48
5.2.170.0170.01215.25
5.2.160.0180.01115.25
5.2.150.0170.01515.25
5.2.140.0170.01515.25
5.2.130.0080.01015.25
5.2.120.0170.01415.25
5.2.110.0190.01415.25
5.2.100.0140.01115.25
5.2.90.0170.01415.25
5.2.80.0070.01414.93
5.2.70.0240.01414.93
5.2.60.0170.01014.93
5.2.50.0160.01314.93
5.2.40.0110.01414.93
5.2.30.0140.01014.89
5.2.20.0130.01414.88
5.2.10.0190.01414.77
5.2.00.0250.01314.77
5.1.60.0090.00914.77
5.1.50.0110.01114.77
5.1.40.0150.00914.77
5.1.30.0140.01114.77
5.1.20.0110.01214.76
5.1.10.0150.01214.76
5.1.00.0170.01514.76
5.0.50.0090.00714.76
5.0.40.0080.01014.76
5.0.30.0030.01614.75
5.0.20.0080.00814.75
5.0.10.0100.00814.73
5.0.00.0080.01314.73
4.4.90.0130.00614.93
4.4.80.0080.00714.93
4.4.70.0040.00814.88
4.4.60.0130.00514.88
4.4.50.0080.00914.82
4.4.40.0080.01014.77
4.4.30.0070.00814.77
4.4.20.0060.01014.76
4.4.10.0030.00914.76
4.4.00.0130.00914.76
4.3.110.0050.00814.75
4.3.100.0110.00614.75
4.3.90.0060.00614.73
4.3.80.0090.00814.73
4.3.70.0030.00814.69
4.3.60.0070.00514.67
4.3.50.0100.00514.65
4.3.40.0060.00914.65
4.3.30.0020.00814.62
4.3.20.0030.00814.62
4.3.10.0080.00614.62
4.3.00.0070.00714.62

preferences:
47.64 ms | 400 KiB | 5 Q