3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = ['a' => '1','b' => 2]; $arr2 = ['h' => 'c','j' => '3']; $max = max(count($arr1), count($arr2)); $keys1 = array_keys($arr1); $keys2 = array_keys($arr2); $result = []; for ($x = 0; $x < $max; ++$x) { if (isset($keys1[$x])) { $result[$keys1[$x]] = $arr1[$keys1[$x]]; } if (isset($keys2[$x])) { $result[$keys2[$x]] = $arr2[$keys2[$x]]; } } 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.4.140.0120.00817.67
8.4.130.0120.00518.58
8.4.120.0100.01023.96
8.4.110.0110.01018.71
8.4.100.0070.01118.77
8.4.90.0100.01020.58
8.4.80.0060.00319.12
8.4.70.0120.00718.01
8.4.60.0130.00918.63
8.4.50.0100.00718.65
8.4.40.0090.00619.47
8.4.30.0040.00718.70
8.4.20.0040.00419.64
8.4.10.0030.01619.76
8.3.270.0140.00916.61
8.3.260.0130.00616.34
8.3.250.0100.00818.94
8.3.240.0070.00919.04
8.3.230.0150.00416.82
8.3.220.0090.00819.10
8.3.210.0030.00418.34
8.3.200.0050.00316.68
8.3.190.0070.00817.38
8.3.180.0060.00317.22
8.3.170.0110.00718.72
8.3.160.0090.00017.08
8.3.150.0120.00620.77
8.3.140.0100.00016.79
8.3.130.0000.00818.27
8.3.120.0110.00420.63
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0140.00426.77
8.3.80.0060.00316.62
8.3.70.0140.00316.75
8.3.60.0150.00318.31
8.3.50.0070.00720.36
8.3.40.0070.00719.04
8.3.30.0060.01018.87
8.3.20.0000.00724.18
8.3.10.0000.00824.66
8.3.00.0030.00526.16
8.2.290.0120.00720.50
8.2.280.0090.00718.59
8.2.270.0070.00717.05
8.2.260.0150.00020.28
8.2.250.0070.01117.01
8.2.240.0040.00817.07
8.2.230.0000.00922.58
8.2.220.0030.00637.54
8.2.210.0080.00026.77
8.2.200.0060.00316.75
8.2.190.0150.00616.58
8.2.180.0140.00425.92
8.2.170.0090.00618.87
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00420.80
8.2.110.0030.00620.57
8.2.100.0080.00417.72
8.2.90.0050.00517.91
8.2.80.0040.00419.36
8.2.70.0050.00317.63
8.2.60.0080.00018.04
8.2.50.0000.00818.07
8.2.40.0000.00820.02
8.2.30.0050.00318.12
8.2.20.0000.00720.49
8.2.10.0050.00217.66
8.2.00.0030.00519.37
8.1.330.0120.00721.86
8.1.320.0100.00817.97
8.1.310.0040.00416.61
8.1.300.0000.00818.39
8.1.290.0060.00330.84
8.1.280.0090.01225.92
8.1.270.0000.00823.99
8.1.260.0120.00626.35
8.1.250.0000.00828.09
8.1.240.0000.00922.59
8.1.230.0040.00720.85
8.1.220.0040.00417.74
8.1.210.0040.00419.01
8.1.200.0060.00317.48
8.1.190.0100.00017.36
8.1.180.0040.00418.10
8.1.170.0050.00518.34
8.1.160.0030.00618.81
8.1.150.0040.00418.64
8.1.140.0050.00217.41
8.1.130.0070.00019.22
8.1.120.0030.00317.53
8.1.110.0040.00417.47
8.1.100.0080.00017.47
8.1.90.0040.00417.47
8.1.80.0030.00617.50
8.1.70.0000.00817.39
8.1.60.0050.00317.66
8.1.50.0000.00817.55
8.1.40.0000.00717.48
8.1.30.0080.00417.69
8.1.20.0130.00017.35
8.1.10.0130.00717.44
8.1.00.0050.01017.43
8.0.300.0000.00719.91
8.0.290.0040.00416.63
8.0.280.0040.00418.39
8.0.270.0000.00716.75
8.0.260.0030.00318.52
8.0.250.0040.00416.89
8.0.240.0040.00416.89
8.0.230.0000.00716.79
8.0.220.0030.00316.70
8.0.210.0080.00416.73
8.0.200.0000.00616.88
8.0.190.0000.00716.82
8.0.180.0030.00516.87
8.0.170.0030.00616.93
8.0.160.0080.00616.89
8.0.150.0050.00816.79
8.0.140.0110.00516.75
8.0.130.0120.00316.77
8.0.120.0150.00316.83
8.0.110.0120.00616.65
8.0.100.0140.00416.88
8.0.90.0150.00416.78
8.0.80.0180.00016.85
8.0.70.0170.00316.78
8.0.60.0140.00516.88
8.0.50.0150.00416.75
8.0.30.0150.00516.68
8.0.20.0130.00516.89
8.0.10.0140.00516.86
7.4.330.0050.00015.55
7.4.320.0080.00016.58
7.4.300.0060.00016.52
7.4.290.0040.00316.46
7.4.280.0100.01316.59
7.4.270.0140.00716.40
7.4.260.0180.00016.63
7.4.250.0110.00216.51
7.4.240.0140.00416.58
7.4.230.0200.00016.27
7.4.220.0200.00516.61
7.4.210.0140.00316.49
7.4.200.0150.00416.48
7.4.190.0190.00016.61
7.4.180.0170.00416.68
7.4.160.0180.00216.56
7.4.150.0170.00616.52
7.4.140.0170.00316.44
7.4.130.0200.00016.43
7.4.120.0030.01216.24
7.4.110.0000.00916.39
7.4.100.0110.00016.43
7.4.90.0030.00616.36
7.4.80.0090.00016.38
7.4.70.0040.00716.11
7.4.60.0150.00416.24
7.4.50.0210.00015.85
7.4.40.0070.01016.18
7.4.30.0130.00316.07
7.4.20.0170.00016.27
7.4.10.0110.00616.21
7.4.00.0080.01116.29

preferences:
31.31 ms | 403 KiB | 5 Q