3v4l.org

run code in 300+ PHP versions simultaneously
<?php $one_array_key = ['A', 'A', 'A', 'B', 'B', 'B']; $second_array_values = ['arn1', 'arn2', 'arn3', 'arn4', 'arn5', 'arn6']; $result = []; foreach ($one_array_key as $index => $value) { $result[$value][] = $second_array_values[$index]; } var_export($result);

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.30.0090.00919.59
8.5.20.0110.00619.40
8.5.10.0100.00916.49
8.5.00.0150.00620.04
8.4.180.0120.01319.71
8.4.170.0130.00921.93
8.4.160.0120.01122.03
8.4.150.0090.00316.90
8.4.140.0140.00817.25
8.4.130.0110.00918.75
8.4.120.0130.00619.41
8.4.110.0080.01023.92
8.4.100.0060.00417.70
8.4.90.0040.00720.51
8.4.80.0060.00419.03
8.4.70.0110.01019.03
8.4.60.0070.00918.50
8.4.50.0090.00218.65
8.4.40.0080.01117.36
8.4.30.0060.01320.58
8.4.20.0040.01518.67
8.4.10.0040.00420.66
8.3.300.0100.01019.27
8.3.290.0100.01220.74
8.3.280.0110.01018.29
8.3.270.0090.01016.56
8.3.260.0130.00616.87
8.3.250.0090.00416.52
8.3.240.0120.00716.85
8.3.230.0150.00416.68
8.3.220.0020.00618.97
8.3.210.0050.00316.86
8.3.200.0040.00516.56
8.3.190.0110.00419.11
8.3.180.0120.00818.99
8.3.170.0090.00918.42
8.3.160.0110.00717.05
8.3.150.0060.01218.89
8.3.140.0080.00016.67
8.3.130.0070.01418.38
8.3.120.0100.01020.55
8.3.110.0000.00816.75
8.3.100.0030.00618.53
8.3.90.0060.00326.77
8.3.80.0070.00316.50
8.3.70.0000.02316.58
8.3.60.0130.00318.40
8.3.50.0040.01118.23
8.3.40.0120.00918.46
8.3.30.0040.01118.49
8.3.20.0040.00724.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.300.0130.00720.35
8.2.290.0110.00816.57
8.2.280.0100.01018.24
8.2.270.0070.01116.34
8.2.260.0140.00318.64
8.2.250.0080.00816.76
8.2.240.0120.00316.93
8.2.230.0080.00020.94
8.2.220.0090.00024.06
8.2.210.0100.00726.77
8.2.200.0060.00316.38
8.2.190.0110.00416.58
8.2.180.0140.00325.92
8.2.170.0170.00018.99
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00020.02
8.2.110.0030.00620.58
8.2.100.0100.00317.91
8.2.90.0050.00320.58
8.2.80.0040.00418.03
8.2.70.0080.00017.93
8.2.60.0060.00317.80
8.2.50.0050.00518.10
8.2.40.0060.00321.26
8.2.30.0000.00719.20
8.2.20.0020.00518.11
8.2.10.0000.00721.01
8.2.00.0030.00319.34
8.1.340.0100.01020.04
8.1.330.0100.00916.16
8.1.320.0140.00516.16
8.1.310.0180.00016.49
8.1.300.0060.00318.12
8.1.290.0090.00030.84
8.1.280.0090.01225.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0090.00023.86
8.1.230.0060.00620.77
8.1.220.0040.00417.74
8.1.210.0000.00718.99
8.1.200.0050.00317.35
8.1.190.0080.00017.22
8.1.180.0000.00818.10
8.1.170.0000.00818.59
8.1.160.0040.00418.75
8.1.150.0070.00018.88
8.1.140.0040.00418.88
8.1.130.0080.00017.44
8.1.120.0000.00717.42
8.1.110.0050.00317.43
8.1.100.0040.00417.34
8.1.90.0060.00317.45
8.1.80.0040.00417.43
8.1.70.0050.00217.37
8.1.60.0050.00317.63
8.1.50.0030.00517.46
8.1.40.0000.01117.41
8.1.30.0030.00617.62
8.1.20.0000.00817.53
8.1.10.0000.00817.39
8.1.00.0000.01017.30
8.0.300.0050.00519.90
8.0.290.0000.00816.75
8.0.280.0000.00718.35
8.0.270.0000.00716.77
8.0.260.0030.00316.71
8.0.250.0030.00316.97
8.0.240.0070.00016.84
8.0.230.0030.00316.95
8.0.220.0000.00716.77
8.0.210.0070.00016.87
8.0.200.0030.00316.98
8.0.190.0040.00416.83
8.0.180.0000.00716.94
8.0.170.0000.01116.91
8.0.160.0050.00216.82
8.0.150.0070.00016.94
8.0.140.0000.00716.86
8.0.130.0030.00313.36
8.0.120.0030.00616.81
8.0.110.0080.00016.78
8.0.100.0030.00516.85
8.0.90.0000.00716.70
8.0.80.0070.00916.92
8.0.70.0000.00716.82
8.0.60.0040.00416.77
8.0.50.0040.00416.95
8.0.30.0030.01316.76
8.0.20.0060.00916.95
8.0.10.0140.00716.96
8.0.00.0040.01117.04
7.4.330.0050.00015.55
7.4.320.0030.00316.60
7.4.300.0030.00316.57
7.4.290.0030.00316.35
7.4.280.0060.00316.38
7.4.270.0030.00516.48
7.4.260.0000.00616.38
7.4.250.0070.00016.39
7.4.240.0070.00016.52
7.4.230.0000.00716.47
7.4.220.0030.00416.46
7.4.210.0070.00816.59
7.4.200.0030.00316.55
7.4.160.0030.01216.54
7.4.150.0030.01616.61
7.4.140.0100.01016.55
7.4.130.0050.00916.30
7.4.120.0110.00316.38
7.4.110.0040.01116.55
7.4.100.0120.00616.34
7.4.90.0040.01116.49
7.4.80.0090.00516.36
7.4.70.0060.01216.45
7.4.60.0040.01416.53
7.4.50.0090.00616.48
7.4.40.0090.00616.33
7.4.30.0040.01116.38
7.4.20.0040.01116.46
7.4.10.0040.01016.56
7.4.00.0110.00416.54
7.3.330.0030.00516.28
7.3.320.0060.00013.25
7.3.310.0090.00016.38
7.3.300.0040.00416.27
7.3.290.0110.00716.34
7.3.270.0070.01416.37
7.3.260.0090.00616.35
7.3.250.0070.00716.27
7.3.240.0070.01016.31
7.3.230.0030.01016.29
7.3.220.0070.01016.29
7.3.210.0060.00916.21
7.3.200.0100.00416.24
7.3.190.0130.00616.28
7.3.180.0060.00916.31
7.3.170.0060.00916.28
7.3.160.0000.01316.21
7.3.150.0030.01116.20
7.3.140.0120.00316.24
7.3.130.0060.00816.27
7.3.120.0000.01416.26
7.3.110.0090.00916.29
7.3.100.0050.01416.19
7.3.90.0120.00616.51
7.3.80.0090.00616.21
7.3.70.0060.00916.33
7.3.60.0070.00716.48
7.3.50.0070.00716.48
7.3.40.0070.00716.47
7.3.30.0070.00716.34
7.3.20.0150.00516.43
7.3.10.0120.00616.42
7.3.00.0090.01016.36

preferences:
84.47 ms | 1399 KiB | 5 Q