3v4l.org

run code in 300+ PHP versions simultaneously
<?php function RecordsToList(Countable & Traversable $input): String { if (count($input) > 0) { $output = "<ol>\n"; foreach ($input as $value) { $output .= "\t<li>" . htmlentities($value) . "</li>\n"; } $output .= "</ol>\n"; return $output; } else { return "<p>No items to display.</p>\n"; } } // Argument 1 passed to RecordsToList() must be Countable and Traversable, array given echo RecordsToList(["Lennon", "McCartney", "Starr", "Harrison"]);

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)
7.4.120.0120.00616.53
7.4.110.0140.00316.31
7.4.100.0100.00716.46
7.4.90.0070.01416.39
7.4.80.0110.00816.30
7.4.70.0090.01216.42
7.4.60.0100.00716.30
7.4.50.0130.00316.36
7.4.40.0110.00716.30
7.4.30.0130.00616.16
7.4.20.0080.00816.49
7.4.10.0140.00416.46
7.4.00.0080.00815.63
7.3.240.0080.01116.30
7.3.230.0140.00716.35
7.3.220.0090.00616.22
7.3.210.0000.01716.41
7.3.200.0140.00416.50
7.3.190.0120.00416.27
7.3.180.0070.01016.24
7.3.170.0070.01116.31
7.3.160.0000.01616.18
7.3.150.0030.01316.41
7.3.140.0030.01416.05
7.3.130.0130.00316.30
7.3.120.0080.00615.51
7.3.110.0060.00915.51
7.3.100.0120.00315.35
7.3.90.0060.01115.25
7.3.80.0130.00415.35
7.3.70.0080.00915.45
7.3.60.0080.00815.35
7.3.50.0030.01215.33
7.3.40.0120.00515.22
7.3.30.0130.00515.46
7.3.20.0090.00815.35
7.3.10.0120.00715.41
7.3.00.0100.00815.39
7.2.340.0150.00416.17
7.2.330.0130.00916.16
7.2.320.0070.01116.22
7.2.310.0030.01416.45
7.2.300.0120.00616.50
7.2.290.0140.00316.28
7.2.280.0140.00316.20
7.2.270.0090.00616.33
7.2.260.0100.00716.49
7.2.250.0030.01415.47
7.2.240.0100.00915.51
7.2.230.0080.00915.70
7.2.220.0120.00415.46
7.2.210.0070.01015.69
7.2.200.0040.01115.50
7.2.190.0050.01215.63
7.2.180.0110.00515.45
7.2.170.0080.00815.46
7.2.160.0080.01315.47
7.2.150.0120.01015.60
7.2.140.0130.00615.36
7.2.130.0110.01115.61
7.2.120.0100.01015.45
7.2.110.0120.00915.78
7.2.100.0100.00915.63
7.2.90.0120.00815.52
7.2.80.0130.00715.67
7.2.70.0130.00815.39
7.2.60.0170.00615.55
7.2.50.0130.01015.62
7.2.40.0090.01115.70
7.2.30.0170.00915.42
7.2.20.0150.00915.54
7.2.10.0140.00915.64
7.2.00.0130.00615.61
7.1.330.0120.01314.58
7.1.320.0290.00614.53
7.1.310.0160.00614.57
7.1.300.0130.01114.38
7.1.290.0190.00814.57
7.1.280.0190.00314.40
7.1.270.0200.01114.46
7.1.260.0140.01214.39
7.1.250.0230.01114.33
7.1.240.0180.01014.29
7.1.230.0170.00814.33
7.1.220.0210.00814.48
7.1.210.0220.00514.48
7.1.200.0170.00814.63
7.1.190.0160.01114.40
7.1.180.0170.00814.54
7.1.170.0190.01114.39
7.1.160.0280.00914.52
7.1.150.0230.00614.42
7.1.140.0230.00314.38
7.1.130.0190.01114.43
7.1.120.0160.01214.44
7.1.110.0200.00814.53
7.1.100.0250.00314.51
7.1.90.0160.01014.53
7.1.80.0200.00614.51
7.1.70.0200.00814.40
7.1.60.0240.01814.44
7.1.50.0250.00714.37
7.1.40.0220.01314.44
7.1.30.0210.01014.44
7.1.20.0230.01214.50
7.1.10.0280.00814.54
7.1.00.0200.00714.34
7.0.330.0240.00614.04
7.0.320.0170.00714.36
7.0.310.0160.00914.02
7.0.300.0140.01114.21
7.0.290.0380.00914.23
7.0.280.0150.01114.04
7.0.270.0200.00914.15
7.0.260.0210.00514.20
7.0.250.0190.01014.21
7.0.240.0150.01214.36
7.0.230.0190.00614.06
7.0.220.0210.00814.10
7.0.210.0140.01014.18
7.0.200.0210.00714.14
7.0.190.0210.00914.24
7.0.180.0210.01014.13
7.0.170.0180.01314.20
7.0.160.0210.01314.13
7.0.150.0210.01114.16
7.0.140.0180.00814.24
7.0.130.0150.01314.18
7.0.120.0190.02216.88
7.0.110.0180.02516.80
7.0.100.0270.02916.78
7.0.90.0210.02516.92
7.0.80.0110.03016.91
7.0.70.0190.03117.66
7.0.60.0160.04218.06
7.0.50.0140.04618.24
7.0.40.0140.04118.24
7.0.30.0230.04118.26
7.0.20.0150.04118.17
7.0.10.0170.03918.19
7.0.00.0150.04018.23
5.6.400.0160.01415.02
5.6.390.0170.00914.97
5.6.380.0150.01314.87
5.6.370.0150.00914.88
5.6.360.0170.00815.03
5.6.350.0180.01114.87
5.6.340.0180.01514.71
5.6.330.0220.00814.75
5.6.320.0170.01014.98
5.6.310.0250.00614.88
5.6.300.0140.01414.99
5.6.290.0170.01214.88
5.6.280.0210.01315.01
5.6.270.0150.02616.84
5.6.260.0130.02616.99
5.6.250.0190.02816.91
5.6.240.0090.03516.95
5.6.230.0170.02816.95
5.6.220.0140.03517.85
5.6.210.0150.03818.39
5.6.200.0140.04718.53
5.6.190.0160.03618.61
5.6.180.0100.04718.57
5.6.170.0160.03918.56
5.6.160.0130.04118.64
5.6.150.0160.03918.48
5.6.140.0180.03718.63
5.6.130.0190.04118.55
5.6.120.0160.03918.54
5.6.110.0240.03918.63
5.6.100.0270.03418.50
5.6.90.0240.03818.49
5.6.80.0180.03718.14
5.6.70.0110.03818.13
5.6.60.0180.03618.23
5.6.50.0190.03718.21
5.6.40.0200.04218.15
5.6.30.0170.03818.14
5.6.20.0210.03518.16
5.6.10.0220.03518.17
5.6.00.0200.04218.14
5.5.380.0160.02615.79
5.5.370.0150.02515.57
5.5.360.0180.03316.90
5.5.350.0110.04817.65
5.5.340.0160.04117.91
5.5.330.0140.04117.84
5.5.320.0160.04117.93
5.5.310.0140.04217.90
5.5.300.0100.04317.81
5.5.290.0120.04217.95
5.5.280.0110.04017.87
5.5.270.0220.04317.84
5.5.260.0180.04117.93
5.5.250.0280.03717.83
5.5.240.0160.03717.55
5.5.230.0160.03617.40
5.5.220.0210.03417.49
5.5.210.0180.03617.49
5.5.200.0230.03617.46
5.5.190.0150.04117.56
5.5.180.0180.03917.46
5.5.170.0160.01214.85
5.5.160.0190.03717.49
5.5.150.0260.03417.35
5.5.140.0200.03417.46
5.5.130.0150.03817.45
5.5.120.0230.03617.46
5.5.110.0230.03517.41
5.5.100.0250.03717.46
5.5.90.0260.03717.42
5.5.80.0270.03117.34
5.5.70.0140.03617.30
5.5.60.0120.03917.41
5.5.50.0190.03517.34
5.5.40.0160.03917.33
5.5.30.0210.03517.44
5.5.20.0210.03817.42
5.5.10.0170.03717.42
5.5.00.0220.03817.32

preferences:
146.49 ms | 1394 KiB | 7 Q