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"; } } // Fatal error: Uncaught TypeError: Argument 1 passed to RecordsToList() must be Countable and Traversable, array given, called in %s on line %d 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.0.60.0070.06020.05
7.0.50.0100.06020.20
7.0.40.0270.05320.21
7.0.30.0270.05720.31
7.0.20.0170.05720.30
7.0.10.0200.05020.27
7.0.00.0170.05720.39
5.6.210.0070.07720.51
5.6.200.0230.06021.11
5.6.190.0230.06021.20
5.6.180.0270.05321.02
5.6.170.0070.06321.03
5.6.160.0130.07721.12
5.6.150.0130.05321.05
5.6.140.0170.05721.02
5.6.130.0230.06021.05
5.6.120.0200.05321.02
5.6.110.0170.06320.99
5.6.100.0170.06021.10
5.6.90.0230.04721.04
5.6.80.0070.06020.42
5.6.70.0100.05720.57
5.6.60.0130.06020.33
5.6.50.0070.06320.41
5.6.40.0130.05320.38
5.6.30.0270.04320.41
5.6.20.0200.04720.30
5.6.10.0200.05020.42
5.6.00.0100.05320.50
5.5.350.0030.08320.30
5.5.340.0230.05720.96
5.5.330.0270.05320.87
5.5.320.0270.05320.87
5.5.310.0230.06021.03
5.5.300.0070.06020.73
5.5.290.0330.05721.02
5.5.280.0130.06020.82
5.5.270.0130.06020.86
5.5.260.0200.06021.02
5.5.250.0200.05320.80
5.5.240.0100.05720.09
5.5.230.0070.06720.24
5.5.220.0300.04720.23
5.5.210.0230.06020.09
5.5.200.0200.05020.14
5.5.190.0130.05320.35
5.5.180.0200.04720.21
5.5.160.0170.04720.32
5.5.150.0130.05020.20
5.5.140.0330.04020.17
5.5.130.0130.05020.21
5.5.120.0170.05020.37
5.5.110.0130.05020.29
5.5.100.0170.07320.28
5.5.90.0270.04020.06
5.5.80.0270.04020.00
5.5.70.0200.06020.09
5.5.60.0270.04719.99
5.5.50.0170.05720.06
5.5.40.0230.05020.13
5.5.30.0200.05320.05
5.5.20.0130.06020.00
5.5.10.0130.06020.04
5.5.00.0200.05720.06

preferences:
135.64 ms | 1394 KiB | 7 Q