3v4l.org

run code in 300+ PHP versions simultaneously
<?php function heaven_knows_why($text, $start, $elements, $step = 1) { $arr = []; for( $i = $start, $j=1, $s=$start; $j <= $elements; $j++, $i++, $s += $step ){ $arr[] = $text . $s; } return $arr; } var_export(heaven_knows_why('file', 2, 5, 3)); echo "\n---\n"; var_export(heaven_knows_why('file', 5, 4, 20)); echo "\n---\n"; var_export(heaven_knows_why('file', 8, 3, 4)); echo "\n---\n"; var_export(heaven_knows_why('file', 3, 3, 7)); echo "\n---\n";

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.5.10.0130.00418.71
8.5.00.0160.00520.04
8.4.150.0030.00014.05
8.4.140.0130.00717.85
8.4.130.0130.00718.75
8.4.120.0120.00824.22
8.4.110.0030.00718.61
8.4.100.0090.01118.87
8.4.90.0130.00820.72
8.4.80.0120.00818.95
8.4.70.0140.00619.16
8.4.60.0110.00918.96
8.4.50.0070.01420.45
8.4.40.0030.00619.41
8.4.30.0130.00620.14
8.4.20.0090.01220.47
8.4.10.0130.00724.31
8.3.280.0120.00918.44
8.3.270.0120.01016.43
8.3.260.0130.00716.86
8.3.250.0140.00619.11
8.3.240.0130.00617.22
8.3.230.0050.00416.50
8.3.220.0060.00219.00
8.3.210.0070.00416.78
8.3.200.0050.00416.54
8.3.190.0120.00616.96
8.3.180.0100.00818.70
8.3.170.0150.00416.54
8.3.160.0060.01317.25
8.3.150.0100.00719.02
8.3.140.0000.00820.80
8.3.130.0000.00818.65
8.3.120.0130.00620.70
8.3.110.0000.01320.94
8.3.100.0030.00824.06
8.3.90.0080.00826.77
8.3.80.0000.00916.50
8.3.70.0110.00716.58
8.3.60.0070.00716.63
8.3.50.0070.01020.08
8.3.40.0090.00919.21
8.3.30.0090.00618.82
8.3.20.0050.00224.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0120.00820.70
8.2.280.0070.00218.41
8.2.270.0120.00316.46
8.2.260.0040.00416.77
8.2.250.0080.00016.91
8.2.240.0040.01217.29
8.2.230.0060.00322.58
8.2.220.0100.00037.54
8.2.210.0070.01126.77
8.2.200.0030.00618.31
8.2.190.0150.00018.16
8.2.180.0040.01125.92
8.2.170.0140.00718.92
8.2.160.0030.01222.96
8.2.150.0030.00625.66
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0040.00426.16
8.2.110.0090.00020.47
8.2.100.0040.00717.91
8.2.90.0090.00017.63
8.2.80.0080.00018.79
8.2.70.0040.00417.75
8.2.60.0030.00617.93
8.2.50.0050.00318.07
8.2.40.0030.00618.29
8.2.30.0080.00018.22
8.2.20.0080.00020.53
8.2.10.0040.00418.16
8.2.00.0040.00419.20
8.1.330.0130.00722.12
8.1.320.0140.00617.88
8.1.310.0040.00416.10
8.1.300.0040.00419.93
8.1.290.0080.00030.84
8.1.280.0090.00925.92
8.1.270.0030.00623.99
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0140.00718.84
8.1.230.0090.00317.82
8.1.220.0060.00317.80
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0100.00018.15
8.1.160.0040.00418.89
8.1.150.0070.00018.59
8.1.140.0080.00017.32
8.1.130.0030.00318.90
8.1.120.0030.00517.32
8.1.110.0050.00317.29
8.1.100.0000.00817.40
8.1.90.0070.00017.43
8.1.80.0000.00817.45
8.1.70.0040.00417.45
8.1.60.0050.00317.61
8.1.50.0040.00417.43
8.1.40.0070.01017.36
8.1.30.0100.00517.68
8.1.20.0000.01017.51
8.1.10.0000.00817.50
8.1.00.0080.00417.29
8.0.300.0090.00018.77
8.0.290.0050.00516.63
8.0.280.0080.00020.19
8.0.270.0070.00017.95
8.0.260.0060.00018.50
8.0.250.0030.00317.02
8.0.240.0030.00316.92
8.0.230.0070.00016.99
8.0.220.0030.00316.84
8.0.210.0030.00316.79
8.0.200.0030.00316.85
8.0.190.0080.00016.98
8.0.180.0040.00416.93
8.0.170.0100.00316.78
8.0.160.0200.00716.87
8.0.150.0140.00916.80
8.0.140.0190.00816.72
8.0.130.0220.00316.76
8.0.120.0150.00416.90
8.0.110.0110.00816.77
8.0.100.0190.00916.88
8.0.90.0260.00016.77
8.0.80.0140.00416.73
8.0.70.0040.00716.89
8.0.60.0000.00816.88
8.0.50.0000.00916.85
8.0.30.0030.00616.86
8.0.20.0120.00616.80
8.0.10.0170.00016.91
7.4.330.0050.00015.55
7.4.320.0000.00616.58
7.4.300.0060.00016.54
7.4.290.0000.00716.61
7.4.280.0170.00516.41
7.4.270.0150.00316.59
7.4.260.0190.00416.65
7.4.250.0230.00016.59
7.4.240.0150.00416.55
7.4.230.0140.00416.55
7.4.220.0150.00016.48
7.4.210.0120.00716.64
7.4.200.0100.01016.50
7.4.190.0080.00816.63
7.4.180.0130.00716.54
7.4.160.0100.00616.48
7.4.150.0160.00316.59
7.4.140.0090.00916.42
7.4.130.0160.00816.27
7.4.120.0190.00016.53
7.4.110.0150.00416.45
7.4.100.0170.00316.52
7.4.90.0180.00516.27
7.4.80.0140.00416.45
7.4.70.0110.00016.37
7.4.60.0120.00016.45
7.4.50.0080.00316.25
7.4.40.0140.00016.37
7.4.30.0070.00716.34
7.4.20.0180.00316.49
7.4.10.0050.01416.48
7.4.00.0180.00016.40

preferences:
34.79 ms | 403 KiB | 5 Q