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(); $citiesHeap = new \SPLHeap(); $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.40.0060.01218.86
8.3.30.0130.00319.09
8.3.20.0080.00020.29
8.3.10.0050.00322.09
8.3.00.0000.00822.51
8.2.170.0140.00422.96
8.2.160.0100.00320.61
8.2.150.0100.00624.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0090.00019.36
8.2.110.0060.00322.25
8.2.100.0090.00317.91
8.2.90.0040.00419.22
8.2.80.0090.00018.04
8.2.70.0040.00417.50
8.2.60.0040.00418.04
8.2.50.0000.01018.07
8.2.40.0000.00718.22
8.2.30.0030.00617.91
8.2.20.0070.00017.57
8.2.10.0000.00819.34
8.2.00.0040.00417.85
8.1.270.0040.00423.95
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00023.96
8.1.230.0060.00619.09
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0030.00517.53
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0000.00721.97
8.1.150.0040.00718.52
8.1.140.0040.00417.45
8.1.130.0030.00317.78
8.1.120.0040.00417.43
8.1.110.0040.00417.38
8.1.100.0000.00817.46
8.1.90.0000.00717.31
8.1.80.0000.00817.31
8.1.70.0030.00317.32
8.1.60.0120.00017.46
8.1.50.0000.00817.53
8.1.40.0050.00217.61
8.1.30.0090.00017.67
8.1.20.0040.00417.59
8.1.10.0070.00017.63
8.1.00.0050.00317.56
8.0.300.0000.00718.77
8.0.290.0040.00417.05
8.0.280.0040.00418.42
8.0.270.0070.00017.17
8.0.260.0060.00316.84
8.0.250.0040.00416.97
8.0.240.0030.00316.92
8.0.230.0030.00316.87
8.0.220.0030.00316.93
8.0.210.0050.00216.83
8.0.200.0000.00617.00
8.0.190.0000.00816.97
8.0.180.0040.00416.86
8.0.170.0030.00516.97
8.0.160.0040.00416.81
8.0.150.0050.00216.97
8.0.140.0000.00816.77
8.0.130.0060.00013.44
8.0.120.0000.00816.92
8.0.110.0000.00816.74
8.0.100.0000.00716.82
8.0.90.0000.00816.89
8.0.80.0140.00316.88
8.0.70.0000.00716.99
8.0.60.0040.00416.72
8.0.50.0040.00416.75
8.0.30.0110.00817.14
8.0.20.0160.00817.40
8.0.10.0030.00316.85
8.0.00.0090.00916.73
7.4.330.0020.00215.00
7.4.320.0000.00716.46
7.4.300.0000.00616.48
7.4.290.0030.00316.44
7.4.280.0000.00916.60
7.4.270.0070.00016.49
7.4.260.0070.00016.50
7.4.250.0040.00416.56
7.4.240.0040.00416.45
7.4.230.0000.00716.43
7.4.220.0150.01216.66
7.4.210.0070.00916.57
7.4.200.0040.00416.51
7.4.190.0040.00416.70
7.4.160.0060.01316.54
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0070.01016.51
7.4.120.0080.00816.57
7.4.110.0170.00016.55
7.4.100.0140.00716.49
7.4.90.0080.01016.54
7.4.80.0090.01216.46
7.4.70.0120.00416.52
7.4.60.0070.01016.54
7.4.50.0060.00316.10
7.4.40.0060.00622.77
7.4.30.0090.00616.44
7.4.00.0060.00814.94
7.3.330.0000.00713.20
7.3.320.0000.00513.10
7.3.310.0000.00816.26
7.3.300.0030.00316.21
7.3.290.0080.00616.28
7.3.280.0110.00516.40
7.3.270.0070.01017.40
7.3.260.0160.00416.66
7.3.250.0100.00816.51
7.3.240.0040.01216.34
7.3.230.0060.00916.43
7.3.210.0070.01016.35
7.3.200.0040.01319.39
7.3.190.0100.01116.39
7.3.180.0060.01016.39
7.3.170.0130.00316.41
7.3.160.0030.01316.29
7.3.120.0050.01314.92
7.3.110.0020.01314.85
7.3.100.0070.00714.78
7.3.90.0030.01114.88
7.3.80.0050.00714.95
7.3.70.0050.00714.62
7.3.60.0080.00614.85
7.3.50.0060.00614.73
7.3.40.0070.00814.72
7.3.30.0030.00914.83
7.3.20.0030.01416.69
7.3.10.0000.01616.50
7.3.00.0100.00516.54
7.2.330.0110.00616.41
7.2.320.0100.00716.57
7.2.310.0150.00616.77
7.2.300.0070.01016.70
7.2.290.0070.01016.70
7.2.250.0070.01114.96
7.2.240.0030.01314.98
7.2.230.0090.00514.91
7.2.220.0030.01015.01
7.2.210.0040.01014.73
7.2.200.0080.00515.04
7.2.190.0100.00514.96
7.2.180.0050.00714.89
7.2.170.0050.00914.93
7.2.160.0030.00614.77
7.2.150.0060.00616.80
7.2.140.0160.00016.98
7.2.130.0070.01016.82
7.2.120.0030.01016.86
7.2.110.0120.00316.74
7.2.100.0590.00816.74
7.2.90.0090.00616.71
7.2.80.0860.00616.78
7.2.70.0170.00616.83
7.2.60.0110.00716.85
7.2.50.0200.00516.82
7.2.40.0140.01116.88
7.2.30.0170.01016.70
7.2.20.0170.00716.75
7.2.10.0170.01116.75
7.2.00.0100.00817.61
7.1.330.0020.01415.45
7.1.320.0090.00215.53
7.1.310.0100.00515.48
7.1.300.0050.00715.45
7.1.290.0040.00915.68
7.1.280.0050.00915.51
7.1.270.0070.00715.56
7.1.260.0070.00615.62
7.1.250.0090.00615.39
7.1.230.1030.00615.72
7.1.220.1460.00315.48
7.1.210.0080.00415.50
7.1.200.0070.00815.62
7.1.190.0130.00315.71
7.1.180.0240.00815.70
7.1.170.0360.00315.45
7.1.160.0310.00615.63
7.1.150.0230.00715.70
7.1.140.0110.00615.62
7.1.130.0030.01415.61
7.1.120.0180.01215.55
7.1.110.0260.01015.50
7.1.100.0090.00616.49
7.1.90.0110.00915.52
7.1.80.0150.00915.64
7.1.70.0110.00316.19
7.1.60.0140.01017.53
7.1.50.0100.01115.97
7.1.40.0150.00616.03
7.1.30.0170.00315.73
7.1.20.0140.01115.95
7.1.10.0110.00315.31
7.1.00.0030.04318.97
7.0.310.0520.00715.09
7.0.300.0180.00315.21
7.0.290.0300.00715.34
7.0.280.0200.01015.12
7.0.270.0350.00815.01
7.0.260.0190.00415.30
7.0.250.0340.00315.43
7.0.240.0060.01215.47
7.0.230.0100.00515.13
7.0.220.0050.01115.30
7.0.210.0170.00315.13
7.0.200.0100.00415.90
7.0.190.0080.00815.34
7.0.180.0100.00515.11
7.0.170.0000.01415.38
7.0.160.0510.00315.14
7.0.150.0130.00315.39
7.0.140.0090.03818.73
7.0.130.0130.00315.37
7.0.120.0580.00315.34
7.0.110.0110.00615.21
7.0.100.0070.02317.55
7.0.90.0050.02017.51
7.0.80.0080.02217.55
7.0.70.0090.04317.53
7.0.60.0100.04317.60
7.0.50.0180.02417.81
7.0.40.0110.02016.69
7.0.30.0040.03416.71
7.0.20.0110.02116.67
7.0.10.0090.03516.57
7.0.00.0100.03016.69
5.6.380.0090.00614.39
5.6.370.0090.00214.11
5.6.360.0140.00614.36
5.6.350.0130.00314.07
5.6.340.0140.00314.34
5.6.330.0130.00314.19
5.6.320.0140.00414.05
5.6.310.0080.00514.09
5.6.300.0140.00314.35
5.6.290.0060.01114.23
5.6.280.0070.04017.54
5.6.270.0170.00014.28
5.6.260.0130.00314.43
5.6.250.0070.02217.47
5.6.240.0080.01917.40
5.6.230.0050.02317.66
5.6.220.0110.02017.51
5.6.210.0060.02317.43
5.6.200.0110.04217.66
5.6.190.0060.04217.80
5.6.180.0100.02017.60
5.6.170.0120.03817.72
5.6.160.0100.03817.58
5.6.150.0050.03017.62
5.6.140.0090.02017.64
5.6.130.0090.04217.65
5.6.120.0100.03817.68
5.6.110.0120.02717.72
5.6.100.0100.02017.59
5.6.90.0090.02317.66
5.6.80.0060.03117.35
5.6.70.0110.03817.34
5.6.60.0120.04017.33
5.6.50.0080.02217.41
5.6.40.0130.03817.28
5.6.30.0140.02717.40
5.6.20.0090.03917.26
5.6.10.0090.02917.29
5.6.00.0100.04017.19
5.5.380.0050.01915.73
5.5.370.0090.01815.78
5.5.360.0090.04015.80
5.5.350.0060.02015.71
5.5.340.0130.04015.84
5.5.330.0020.02915.95
5.5.320.0060.04515.92
5.5.310.0120.03815.79
5.5.300.0100.02315.98
5.5.290.0050.03815.96
5.5.280.0030.04215.95
5.5.270.0100.03816.03
5.5.260.0080.02215.91
5.5.250.0050.03815.90
5.5.240.0060.02015.69
5.5.230.0080.04015.44
5.5.220.0080.04215.60
5.5.210.0060.03515.67
5.5.200.0110.02615.66
5.5.190.0060.04515.60
5.5.180.0050.02215.67
5.5.170.0070.00814.18
5.5.160.0060.03015.67
5.5.150.0070.03015.49
5.5.140.0070.02215.63
5.5.130.0050.03415.66
5.5.120.0050.02915.50
5.5.110.0050.02115.76
5.5.100.0060.02015.52
5.5.90.0130.03415.52
5.5.80.0050.02215.65
5.5.70.0060.02115.46
5.5.60.0070.03715.61
5.5.50.0080.03215.40
5.5.40.0030.03315.58
5.5.30.0070.02015.51
5.5.20.0120.01515.52
5.5.10.0110.03615.65
5.5.00.0060.02215.60
5.4.450.0040.04215.29
5.4.440.0090.03215.14
5.4.430.0090.01715.34
5.4.420.0080.01815.04
5.4.410.0080.02815.04
5.4.400.0080.02314.91
5.4.390.0030.02315.10
5.4.380.0100.01515.05
5.4.370.0130.03814.89
5.4.360.0070.03814.96
5.4.350.0090.01915.06
5.4.340.0040.02114.88
5.4.330.0110.00010.77
5.4.320.0080.02215.03
5.4.310.0080.03214.82
5.4.300.0060.02015.04
5.4.290.0050.03714.84
5.4.280.0090.02515.04
5.4.270.0070.02214.87
5.4.260.0050.03015.06
5.4.250.0100.04015.00
5.4.240.0080.04215.14
5.4.230.0070.02215.00
5.4.220.0140.02514.88
5.4.210.0100.02315.05
5.4.200.0060.02515.12
5.4.190.0090.01814.93
5.4.180.0080.02014.86
5.4.170.0070.02314.97
5.4.160.0070.02014.84
5.4.150.0030.02615.03
5.4.140.0050.02313.67
5.4.130.0060.02113.60
5.4.120.0080.03813.70
5.4.110.0060.02613.76
5.4.100.0030.02313.53
5.4.90.0040.02213.80
5.4.80.0100.02313.67
5.4.70.0050.02013.57
5.4.60.0020.02213.50
5.4.50.0030.02013.71
5.4.40.0080.02813.60
5.4.30.0070.02013.69
5.4.20.0040.01913.60
5.4.10.0050.02413.57
5.4.00.0080.03513.41
5.3.290.0080.02712.65
5.3.280.0070.02512.64
5.3.270.0040.04512.68
5.3.260.0060.02012.62
5.3.250.0120.02012.69
5.3.240.0060.03612.67
5.3.230.0040.03012.60
5.3.220.0040.02212.63
5.3.210.0030.02012.56
5.3.200.0030.03112.65
5.3.190.0090.01812.61
5.3.180.0070.01712.61
5.3.170.0060.02212.62
5.3.160.0040.03112.58
5.3.150.0070.01812.59
5.3.140.0090.02212.66
5.3.130.0060.02212.59
5.3.120.0080.03612.62
5.3.110.0040.02812.61
5.3.100.0080.04012.36
5.3.90.0000.02312.37
5.3.80.0030.03212.37
5.3.70.0040.03812.26
5.3.60.0030.01812.38
5.3.50.0040.02812.23
5.3.40.0060.02112.23
5.3.30.0070.01812.32
5.3.20.0070.03912.17
5.3.10.0060.03912.20
5.3.00.0090.03012.13
5.2.170.0030.01510.95
5.2.160.0030.03210.91
5.2.150.0050.02310.94
5.2.140.0080.01310.88
5.2.130.0080.01210.79
5.2.120.0040.02710.92
5.2.110.0060.01710.91
5.2.100.0080.01110.89
5.2.90.0030.03510.93
5.2.80.0060.01510.89
5.2.70.0030.02510.81
5.2.60.0020.01910.84
5.2.50.0070.02210.77
5.2.40.0060.01710.75
5.2.30.0050.03410.81
5.2.20.0040.03410.80
5.2.10.0050.01310.70
5.2.00.0060.01310.63
5.1.60.0070.01310.34
5.1.50.0020.02010.31
5.1.40.0030.01310.34
5.1.30.0060.01310.51
5.1.20.0070.01310.52
5.1.10.0070.02710.39
5.1.00.0090.01610.36
5.0.50.0020.01110.17
5.0.40.0030.02010.17
5.0.30.0040.01710.17
5.0.20.0060.01310.17
5.0.10.0010.01410.17
5.0.00.0040.02510.17
4.4.90.0030.01010.17
4.4.80.0020.01410.17
4.4.70.0020.00810.17
4.4.60.0020.00810.17
4.4.50.0040.00810.17
4.4.40.0000.02210.17
4.4.30.0040.01210.17
4.4.20.0020.01010.17
4.4.10.0010.01410.17
4.4.00.0020.02110.17
4.3.110.0060.00510.17
4.3.100.0030.00810.17
4.3.90.0060.01210.17
4.3.80.0030.01610.17
4.3.70.0020.01910.17
4.3.60.0000.01310.17
4.3.50.0010.01010.17
4.3.40.0050.01010.17
4.3.30.0010.01110.17
4.3.20.0000.01710.17
4.3.10.0020.01310.17
4.3.00.0020.01310.17

preferences:
44.38 ms | 400 KiB | 5 Q