3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["firstname" => "John", "lastname" => "", "email" => "", "uri" => ""], ["firstname" => "", "lastname" => "Smith", "email" => "", "uri" => ""], ["firstname" => "", "lastname" => "", "email" => "john@example.org", "uri" => ""] ]; $result = array_shift($array); // remove the first row and push it into the result array foreach ($array as $row) { foreach ($row as $key => $value) { if ($value !== '') { $result[$key] = $value; // only overwrite where a non-empty value exists } } } 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.130.0070.00218.77
8.4.120.0110.00924.13
8.4.110.0140.00918.68
8.4.100.0080.00418.52
8.4.90.0080.01218.71
8.4.80.0090.00818.05
8.4.70.0140.00517.75
8.4.60.0120.00918.60
8.4.50.0110.00819.45
8.4.40.0060.01319.50
8.4.30.0060.01320.55
8.4.20.0140.00018.96
8.4.10.0130.00719.59
8.3.260.0130.00716.65
8.3.250.0100.00818.97
8.3.240.0100.00817.05
8.3.230.0110.01016.51
8.3.220.0040.00517.37
8.3.210.0070.00216.85
8.3.200.0030.00616.69
8.3.190.0120.00917.29
8.3.180.0140.00520.55
8.3.170.0130.00617.29
8.3.160.0070.01118.21
8.3.150.0160.00420.75
8.3.140.0040.01416.63
8.3.130.0040.00418.50
8.3.120.0030.00620.57
8.3.110.0030.00616.53
8.3.100.0050.00318.45
8.3.90.0050.00326.77
8.3.80.0030.00619.36
8.3.70.0130.00716.58
8.3.60.0130.00316.63
8.3.50.0180.00316.40
8.3.40.0110.00718.88
8.3.30.0040.01118.67
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0070.00026.16
8.2.290.0060.01220.16
8.2.280.0100.00918.46
8.2.270.0060.01217.17
8.2.260.0110.00719.96
8.2.250.0040.00417.18
8.2.240.0150.00419.08
8.2.230.0100.00020.94
8.2.220.0090.00024.06
8.2.210.0110.00426.77
8.2.200.0090.00018.88
8.2.190.0130.00618.13
8.2.180.0040.01425.92
8.2.170.0110.00419.09
8.2.160.0130.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00626.35
8.2.110.0060.00319.30
8.2.100.0060.00617.91
8.2.90.0000.00720.60
8.2.80.0040.00817.97
8.2.70.0000.00817.63
8.2.60.0050.00317.93
8.2.50.0080.00018.05
8.2.40.0030.00520.07
8.2.30.0040.00418.19
8.2.20.0040.00418.22
8.2.10.0040.00419.33
8.2.00.0000.00819.25
8.1.330.0050.01321.85
8.1.320.0070.00416.13
8.1.310.0180.00018.47
8.1.300.0070.00417.78
8.1.290.0030.00630.84
8.1.280.0070.01025.92
8.1.270.0000.00723.99
8.1.260.0040.00428.09
8.1.250.0050.00328.09
8.1.240.0080.00422.08
8.1.230.0040.00721.03
8.1.220.0080.00017.76
8.1.210.0000.00719.09
8.1.200.0060.00317.35
8.1.190.0060.00317.35
8.1.180.0060.00318.10
8.1.170.0040.00418.59
8.1.160.0050.00319.02
8.1.150.0000.00718.84
8.1.140.0040.00418.90
8.1.130.0030.00320.14
8.1.120.0040.00417.36
8.1.110.0000.00817.36
8.1.100.0040.00417.38
8.1.90.0070.00017.48
8.1.80.0070.00317.36
8.1.70.0040.00417.48
8.1.60.0000.00817.49
8.1.50.0000.00917.52
8.1.40.0040.00417.53
8.1.30.0080.00017.68
8.1.20.0090.00017.70
8.1.10.0080.00017.52
8.1.00.0000.00817.51
8.0.300.0000.00820.04
8.0.290.0040.00416.75
8.0.280.0030.00318.38
8.0.270.0000.00717.95
8.0.260.0060.00018.42
8.0.250.0050.00316.95
8.0.240.0000.00716.97
8.0.230.0060.00016.96
8.0.220.0050.00316.88
8.0.210.0040.00316.79
8.0.200.0000.00716.87
8.0.190.0090.00016.97
8.0.180.0000.00816.91
8.0.170.0030.00616.90
8.0.160.0000.00716.88
8.0.150.0030.00716.73
8.0.140.0040.00416.81
8.0.130.0030.00313.32
8.0.120.0000.00816.92
8.0.110.0040.00416.85
8.0.100.0020.00516.85
8.0.90.0040.00416.72
8.0.80.0060.01116.82
8.0.70.0000.00716.85
8.0.60.0000.00717.02
8.0.50.0000.00816.79
8.0.30.0060.00916.86
8.0.20.0060.01616.87
8.0.10.0070.01417.06
8.0.00.0060.01016.98
7.4.330.0030.00315.55
7.4.320.0000.00616.62
7.4.300.0000.00616.67
7.4.290.0000.00816.39
7.4.280.0040.00416.50
7.4.270.0070.00016.44
7.4.260.0020.00213.27
7.4.250.0000.00716.48
7.4.240.0030.00316.53
7.4.230.0030.00316.61
7.4.220.0030.00316.44
7.4.210.0070.00716.59
7.4.200.0070.00016.36
7.4.160.0160.00916.57
7.4.150.0110.01416.59
7.4.140.0180.00016.54
7.4.130.0040.01116.56
7.4.120.0060.00916.37
7.4.110.0070.00716.49
7.4.100.0090.00616.55
7.4.90.0000.01516.55
7.4.80.0040.01116.35
7.4.70.0080.00616.41
7.4.60.0070.01016.64
7.4.50.0060.01616.27
7.4.40.0000.01516.45
7.4.30.0130.00716.58
7.4.20.0070.00716.41
7.4.10.0090.00616.66
7.4.00.0090.00916.57
7.3.330.0000.00716.18
7.3.320.0000.00513.08
7.3.310.0030.00316.26
7.3.300.0030.00316.19
7.3.290.0090.00616.40
7.3.270.0140.00716.25
7.3.260.0100.00416.37
7.3.250.0030.01216.32
7.3.240.0090.00616.27
7.3.230.0000.01516.38
7.3.220.0040.01116.32
7.3.210.0110.00416.24
7.3.200.0070.00716.18
7.3.190.0000.01516.30
7.3.180.0070.01116.29
7.3.170.0060.00916.15
7.3.160.0100.01016.24
7.3.150.0120.00316.28
7.3.140.0130.00616.30
7.3.130.0070.00716.23
7.3.120.0120.00316.29
7.3.110.0070.00716.26
7.3.100.0040.01116.24
7.3.90.0040.01116.48
7.3.80.0030.01016.26
7.3.70.0070.00716.36
7.3.60.0090.00916.41
7.3.50.0110.00316.46
7.3.40.0060.01016.47
7.3.30.0090.00716.44
7.3.20.0070.01416.49
7.3.10.0120.00916.34
7.3.00.0100.00616.42

preferences:
52.24 ms | 403 KiB | 5 Q