3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array( 'id' => 1, 'user_name'=>'test1' ), array( 'id' => 2, 'user_name'=>'test2' ), array( 'id' => 3, 'user_name'=>'test3' ) ); $arr2 = array( array( 'id' => 1, 'shop_name'=>'shop1' ), array( 'id' => 5, 'shop_name'=>'shop2' ), array( 'id' => 3, 'shop_name'=>'shop3' ) ); $user_name = array_column($arr, 'user_name', 'id'); $shop_name = array_column($arr, 'shop_name', 'id'); $arr = []; foreach($user_name as $id => $user) { $temp = ['id'=>$id, 'user_name'=>$user, 'shop_name'=>'']; if(array_key_exists($id, $shop_name)) $temp['shop_name'] = $shop_name[$id]; $arr[] = $temp; } print_r($arr);

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.3.60.0040.01516.63
8.3.50.0090.01016.36
8.3.40.0120.00918.70
8.3.30.0030.01318.70
8.3.20.0080.00018.77
8.3.10.0030.00620.36
8.3.00.0040.00419.26
8.2.180.0140.00718.54
8.2.170.0170.00322.96
8.2.160.0100.00320.58
8.2.150.0040.00424.18
8.2.140.0210.00024.66
8.2.130.0070.00026.16
8.2.120.0030.00619.49
8.2.110.0030.00620.40
8.2.100.0040.00817.84
8.2.90.0070.00417.75
8.2.80.0060.00317.97
8.2.70.0030.00517.92
8.2.60.0080.00018.34
8.2.50.0000.00918.10
8.2.40.0030.00619.48
8.2.30.0000.00719.24
8.2.20.0070.00017.76
8.2.10.0040.00417.68
8.2.00.0000.00817.81
8.1.280.0130.01325.92
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00822.19
8.1.230.0060.00618.99
8.1.220.0070.00017.74
8.1.210.0000.00918.77
8.1.200.0090.00017.35
8.1.190.0040.00417.25
8.1.180.0030.00518.10
8.1.170.0030.00618.61
8.1.160.0070.00018.78
8.1.150.0000.00918.80
8.1.140.0000.00817.37
8.1.130.0070.00017.73
8.1.120.0000.00717.46
8.1.110.0070.00017.33
8.1.100.0040.00317.51
8.1.90.0040.00417.44
8.1.80.0050.00217.49
8.1.70.0000.00817.44
8.1.60.0000.00817.58
8.1.50.0040.00417.49
8.1.40.0030.00617.56
8.1.30.0080.00017.67
8.1.20.0080.00017.72
8.1.10.0070.00017.39
8.1.00.0000.01217.35
8.0.300.0040.00418.78
8.0.290.0000.00816.75
8.0.280.0000.00818.52
8.0.270.0000.00816.83
8.0.260.0030.00316.84
8.0.250.0040.00416.96
8.0.240.0060.00316.84
8.0.230.0000.00717.01
8.0.220.0000.00716.97
8.0.210.0030.00316.89
8.0.200.0000.00716.99
8.0.190.0000.00716.97
8.0.180.0050.00216.93
8.0.170.0070.00416.95
8.0.160.0000.00716.90
8.0.150.0040.00416.73
8.0.140.0000.00716.75
8.0.130.0030.00313.36
8.0.120.0030.00616.89
8.0.110.0040.00416.91
8.0.100.0050.00216.83
8.0.90.0050.00316.73
8.0.80.0060.01316.82
8.0.70.0000.00817.02
8.0.60.0040.00416.78
8.0.50.0070.00016.81
8.0.30.0080.01016.85
8.0.20.0110.00817.04
8.0.10.0030.00516.93
8.0.00.0110.01316.88
7.4.330.0020.00213.00
7.4.320.0000.00816.55
7.4.300.0060.00016.59
7.4.290.0050.00216.58
7.4.280.0050.00316.50
7.4.270.0050.00316.45
7.4.260.0030.00313.28
7.4.250.0030.00616.47
7.4.240.0000.00716.50
7.4.230.0030.00516.60
7.4.220.0120.00616.55
7.4.210.0090.00716.60
7.4.200.0000.00716.62
7.4.190.0080.00016.58
7.4.160.0090.00616.68
7.4.150.0090.01116.50
7.4.140.0050.01616.36
7.4.130.0100.01016.47
7.4.120.0070.01316.39
7.4.110.0070.01116.53
7.4.100.0050.01316.55
7.4.90.0090.00916.54
7.4.80.0080.01519.39
7.4.70.0030.01316.47
7.4.60.0040.01216.53
7.4.50.0040.00416.55
7.4.40.0100.00616.61
7.4.30.0080.00816.61
7.4.00.0030.00715.19
7.3.330.0000.00613.09
7.3.320.0020.00213.21
7.3.310.0000.00716.18
7.3.300.0030.00316.25
7.3.290.0000.01416.38
7.3.280.0070.01216.39
7.3.270.0110.00716.31
7.3.260.0030.01316.61
7.3.250.0130.00816.37
7.3.240.0120.00416.16
7.3.230.0120.00616.48
7.3.210.0070.01016.43
7.3.200.0090.00616.41
7.3.190.0060.01216.42
7.3.180.0100.00716.23
7.3.170.0060.01316.36
7.3.160.0100.00616.27
7.3.120.0060.00615.02
7.2.330.0140.00916.53
7.2.320.0070.01016.68
7.2.310.0060.01816.56
7.2.300.0070.00816.38
7.2.290.0090.00916.72
7.2.00.0080.00619.40
7.1.100.0060.00617.86
7.1.70.0030.00917.16
7.1.60.0140.01019.40
7.1.50.0100.01017.11
7.1.00.0000.08022.40
7.0.200.0000.01016.89
7.0.140.0000.07722.12
7.0.120.0070.07022.16
7.0.60.0030.09019.93
7.0.50.0030.04317.94
7.0.40.0070.08020.11
7.0.30.0170.08020.16
7.0.20.0100.06020.24
7.0.10.0170.08320.30
7.0.00.0130.07720.14
5.6.280.0100.06720.88
5.6.210.0070.03720.50
5.6.200.0170.07318.28
5.6.190.0070.09320.43
5.6.180.0100.09020.57
5.6.170.0170.07720.47
5.6.160.0030.05320.47
5.6.150.0000.05020.49
5.6.140.0130.03720.23
5.6.130.0200.04320.42
5.6.120.0000.06720.32
5.6.110.0070.05020.36
5.6.100.0070.05020.39
5.6.90.0100.07720.48
5.6.80.0030.07319.72
5.6.70.0070.08319.54
5.6.60.0030.08019.81
5.6.50.0030.08019.75
5.6.40.0130.04719.54
5.6.30.0030.04319.64
5.6.20.0030.04319.54
5.6.10.0070.04319.69
5.6.00.0100.03719.68
5.5.350.0030.08320.40
5.5.340.0000.04718.07
5.5.330.0030.04720.27
5.5.320.0070.08320.34
5.5.310.0070.08720.37
5.5.300.0070.06720.30
5.5.290.0100.06720.13
5.5.280.0070.06320.23
5.5.270.0130.08020.03
5.5.260.0100.08320.14
5.5.250.0000.08320.02
5.5.240.0030.08719.38
5.5.230.0100.06019.58
5.5.220.0000.04719.48
5.5.210.0100.05319.51
5.5.200.0030.09019.69
5.5.190.0100.05019.47
5.5.180.0130.07319.69
5.5.160.0030.04019.64
5.5.150.0070.08319.64
5.5.140.0030.09019.64
5.5.130.0100.08019.32
5.5.120.0070.08019.57
5.5.110.0070.07719.30
5.5.100.0070.08019.58
5.5.90.0070.05719.23
5.5.80.0130.04319.21
5.5.70.0100.05719.56
5.5.60.0070.08319.35
5.5.50.0130.07319.53
5.5.40.0170.03319.39
5.5.30.0070.04319.48
5.5.20.0130.07019.37
5.5.10.0200.07019.42
5.5.00.0070.08719.26
5.4.450.0030.08719.50
5.4.440.0070.07019.33
5.4.430.0070.05019.23
5.4.420.0000.04319.50
5.4.410.0200.06319.00
5.4.400.0000.07319.08
5.4.390.0070.05018.80
5.4.380.0030.04318.79
5.4.370.0030.04019.02
5.4.360.0070.08018.91
5.4.350.0030.05719.00
5.4.340.0030.05319.14
5.4.320.0100.05718.79
5.4.310.0130.03719.18
5.4.300.0100.06018.91
5.4.290.0100.03319.14
5.4.280.0100.04319.07
5.4.270.0130.07018.79
5.4.260.0100.04318.79
5.4.250.0100.08018.91
5.4.240.0070.03719.17
5.4.230.0000.04719.14
5.4.220.0130.07019.09
5.4.210.0070.07319.07
5.4.200.0070.07018.91
5.4.190.0030.07719.11
5.4.180.0070.03719.16
5.4.170.0070.07319.11
5.4.160.0070.04019.09
5.4.150.0100.06718.93
5.4.140.0070.07316.25
5.4.130.0030.05316.23
5.4.120.0030.05016.44
5.4.110.0070.07316.43
5.4.100.0030.04316.24
5.4.90.0170.06716.36
5.4.80.0030.06716.39
5.4.70.0130.07016.21
5.4.60.0070.07716.22
5.4.50.0030.06016.30
5.4.40.0230.04016.29
5.4.30.0070.03316.33
5.4.20.0070.07016.23
5.4.10.0000.05016.33
5.4.00.0000.06715.82
5.3.290.0070.07714.55
5.3.280.0070.06314.53
5.3.270.0130.03014.43
5.3.260.0100.06714.54
5.3.250.0030.05014.54
5.3.240.0070.05314.51
5.3.230.0070.07714.61
5.3.220.0030.04014.51
5.3.210.0100.07714.47
5.3.200.0030.07014.50
5.3.190.0030.08314.36
5.3.180.0000.07014.51
5.3.170.0030.04714.45
5.3.160.0130.03314.52
5.3.150.0100.07014.58
5.3.140.0070.05714.50
5.3.130.0170.06014.37
5.3.120.0030.07014.58
5.3.110.0130.04014.47
5.3.100.0100.07714.13
5.3.90.0000.05313.94
5.3.80.0070.05713.81
5.3.70.0170.06313.84
5.3.60.0000.06013.94
5.3.50.0030.07013.87
5.3.40.0030.07713.77
5.3.30.0130.06713.89
5.3.20.0070.07313.61
5.3.10.0030.06313.61
5.3.00.0000.08313.66
5.2.170.0070.06011.05
5.2.160.0070.04311.23
5.2.150.0030.03311.09
5.2.140.0070.03311.12
5.2.130.0070.03010.99
5.2.120.0100.05710.96
5.2.110.0000.03711.09
5.2.100.0000.06311.00
5.2.90.0070.06311.00
5.2.80.0070.04711.19
5.2.70.0030.05311.09
5.2.60.0000.06311.03
5.2.50.0030.06010.95
5.2.40.0070.06010.90
5.2.30.0000.06310.95
5.2.20.0100.04010.97
5.2.10.0030.03310.89
5.2.00.0030.03310.73
5.1.60.0030.05310.00
5.1.50.0030.05310.04
5.1.40.0070.02710.04
5.1.30.0070.05710.39
5.1.20.0000.04710.39
5.1.10.0030.0609.98
5.1.00.0130.0479.91
5.0.50.0030.0408.52
5.0.40.0030.0438.32
5.0.30.0100.0578.27
5.0.20.0070.0378.35
5.0.10.0000.0478.25
5.0.00.0000.0708.16
4.4.90.0000.0377.31
4.4.80.0000.0277.31
4.4.70.0030.0377.31
4.4.60.0030.0277.31
4.4.50.0000.0237.31
4.4.40.0070.0277.31
4.4.30.0030.0207.31
4.4.20.0000.0277.31
4.4.10.0000.0207.31
4.4.00.0030.0477.31
4.3.110.0000.0207.31
4.3.100.0000.0337.31
4.3.90.0000.0377.31
4.3.80.0000.0577.31
4.3.70.0000.0207.31
4.3.60.0030.0177.31
4.3.50.0030.0137.31
4.3.40.0000.0237.31
4.3.30.0000.0177.31
4.3.20.0030.0137.31
4.3.10.0000.0177.31
4.3.00.0030.0137.31

preferences:
42.47 ms | 401 KiB | 5 Q