3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month = [ 'January', 'January', 'January', 'January', 'February' ]; $weeks = [ 'Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 1' ]; $newArray = []; foreach ($month as $index => $value) { // Create the new string you want, using the same index for both arrays $newArray[] = $value . ' - ' . $weeks[$index]; } print_r($newArray);

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.4.130.0060.00318.93
8.4.120.0080.01223.82
8.4.110.0100.00918.73
8.4.100.0070.01118.61
8.4.90.0060.00220.38
8.4.80.0150.00617.59
8.4.70.0050.00417.64
8.4.60.0140.00618.85
8.4.50.0120.00817.70
8.4.40.0040.00419.29
8.4.30.0130.00620.71
8.4.20.0160.00017.86
8.4.10.0090.00018.70
8.3.250.0100.00618.79
8.3.240.0110.00817.04
8.3.230.0100.00916.62
8.3.220.0050.00517.26
8.3.210.0050.00316.57
8.3.200.0110.00516.85
8.3.190.0100.00417.22
8.3.180.0080.00618.65
8.3.170.0100.01016.83
8.3.160.0090.00916.72
8.3.150.0090.00918.78
8.3.140.0060.00316.91
8.3.130.0060.00318.57
8.3.120.0110.00020.73
8.3.110.0080.00020.94
8.3.100.0070.00316.75
8.3.90.0040.00426.77
8.3.80.0060.00318.38
8.3.70.0100.01016.75
8.3.60.0080.00818.55
8.3.50.0170.01418.23
8.3.40.0070.00721.99
8.3.30.0080.00619.15
8.3.20.0080.00024.18
8.3.10.0080.00024.66
8.3.00.0090.00026.16
8.2.290.0120.00820.23
8.2.280.0050.01018.27
8.2.270.0140.00318.38
8.2.260.0120.00617.31
8.2.250.0080.00018.62
8.2.240.0070.01018.73
8.2.230.0160.00022.58
8.2.220.0100.00024.06
8.2.210.0160.00026.77
8.2.200.0090.00018.32
8.2.190.0090.00616.58
8.2.180.0080.00825.92
8.2.170.0150.00618.99
8.2.160.0070.01322.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0000.00721.13
8.2.110.0070.01120.77
8.2.100.0060.00617.91
8.2.90.0060.00317.97
8.2.80.0040.00419.21
8.2.70.0080.00017.75
8.2.60.0030.00717.93
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0090.00018.13
8.2.20.0040.00420.35
8.2.10.0040.00418.05
8.2.00.0000.00719.32
8.1.330.0130.00822.24
8.1.320.0110.00716.16
8.1.310.0090.00916.68
8.1.300.0000.00916.13
8.1.290.0040.00430.84
8.1.280.0080.01225.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0070.00319.13
8.1.230.0110.00020.85
8.1.220.0080.00017.79
8.1.210.0080.00018.79
8.1.200.0040.00417.23
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0000.01218.34
8.1.160.0030.00518.89
8.1.150.0000.00818.57
8.1.140.0040.00417.41
8.1.130.0080.00117.88
8.1.120.0080.00317.46
8.1.110.0080.00218.06
8.1.100.0050.00618.11
8.1.90.0060.00618.00
8.1.80.0050.00718.07
8.1.70.0040.00818.03
8.1.60.0090.00418.14
8.1.50.0110.00218.09
8.1.40.0140.00618.06
8.1.30.0180.00018.14
8.1.20.0120.00518.09
8.1.10.0140.00418.06
8.1.00.0110.00718.00
8.0.300.0070.00020.21
8.0.290.0070.00016.58
8.0.280.0000.00820.22
8.0.270.0030.00318.00
8.0.260.0050.00517.97
8.0.250.0080.00317.50
8.0.240.0090.00217.49
8.0.230.0070.00517.50
8.0.220.0050.00717.41
8.0.210.0040.00517.43
8.0.200.0050.00617.49
8.0.190.0050.00617.43
8.0.180.0050.00517.45
8.0.170.0120.00317.44
8.0.160.0120.00317.45
8.0.150.0120.00317.39
8.0.140.0080.00617.37
8.0.130.0130.00217.43
8.0.120.0130.00317.43
8.0.110.0130.00417.47
8.0.100.0140.00317.41
8.0.90.0120.00317.46
8.0.80.0100.00617.38
8.0.70.0120.00517.49
8.0.60.0130.00416.91
8.0.50.0120.00216.90
8.0.30.0080.00616.88
8.0.20.0100.00516.93
8.0.10.0110.00316.90
7.4.330.0050.00516.48
7.4.320.0100.00316.82
7.4.300.0050.00816.85
7.4.290.0080.00516.83
7.4.280.0120.00616.79
7.4.270.0140.00416.80
7.4.260.0130.00616.80
7.4.250.0130.00616.78
7.4.240.0100.00816.82
7.4.230.0160.00316.77
7.4.220.0130.00316.83
7.4.210.0110.00416.80
7.4.200.0120.00316.82
7.4.190.0110.00516.81
7.4.180.0130.00216.83
7.4.160.0120.00416.81
7.4.150.0110.00416.78
7.4.140.0110.00516.77
7.4.130.0100.00616.77
7.4.120.0140.00216.82
7.4.110.0120.00416.75
7.4.100.0140.00116.83
7.4.90.0090.00716.78
7.4.80.0110.00516.75
7.4.70.0110.00516.79
7.4.60.0100.00616.78
7.4.50.0110.00416.75
7.4.40.0110.00416.78
7.4.30.0080.00816.80
7.4.20.0070.00916.79
7.4.10.0110.00416.74
7.4.00.0150.00016.81

preferences:
87.38 ms | 403 KiB | 5 Q