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' ) ); $shop_name = array_column($arr2, 'shop_name', 'id'); foreach($arr as $key => $item) { $exist = array_key_exists($item['id'], $shop_name); $arr[$key]['shop_name'] = $exist ? $shop_name[$item['id']] : ''; } 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.0190.00318.43
8.3.50.0070.01221.20
8.3.40.0120.00318.83
8.3.30.0060.00918.67
8.3.20.0100.01018.60
8.3.10.0070.00020.92
8.3.00.0090.00023.65
8.2.180.0120.00916.75
8.2.170.0100.01622.96
8.2.160.0070.00720.37
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00021.11
8.2.110.0050.00519.38
8.2.100.0110.00417.84
8.2.90.0040.00417.63
8.2.80.0030.00517.97
8.2.70.0000.00817.93
8.2.60.0000.00818.34
8.2.50.0030.00518.10
8.2.40.0050.00319.22
8.2.30.0000.00719.34
8.2.20.0050.00317.65
8.2.10.0040.00417.70
8.2.00.0000.00717.70
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0150.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00322.80
8.1.230.0120.00017.89
8.1.220.0040.00417.76
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0040.00418.64
8.1.160.0040.00418.89
8.1.150.0030.00518.94
8.1.140.0000.00717.37
8.1.130.0000.00717.82
8.1.120.0030.00317.53
8.1.110.0050.00317.47
8.1.100.0050.00217.49
8.1.90.0090.00017.50
8.1.80.0030.00317.46
8.1.70.0000.00717.34
8.1.60.0000.00717.51
8.1.50.0040.00417.46
8.1.40.0050.00217.54
8.1.30.0030.00617.63
8.1.20.0080.00017.63
8.1.10.0000.00717.41
8.1.00.0030.00517.42
8.0.300.0080.00018.77
8.0.290.0000.00916.75
8.0.280.0070.00018.51
8.0.270.0000.00717.25
8.0.260.0030.00316.81
8.0.250.0040.00416.93
8.0.240.0060.00316.99
8.0.230.0000.00716.95
8.0.220.0070.00016.76
8.0.210.0050.00216.86
8.0.200.0050.00316.93
8.0.190.0080.00016.94
8.0.180.0000.01016.91
8.0.170.0070.00016.97
8.0.160.0030.00316.86
8.0.150.0040.00416.87
8.0.140.0030.00316.88
8.0.130.0030.00313.31
8.0.120.0000.00816.90
8.0.110.0000.00716.93
8.0.100.0000.00716.72
8.0.90.0040.00416.84
8.0.80.0080.00716.94
8.0.70.0000.00716.75
8.0.60.0070.00016.91
8.0.50.0070.00016.95
8.0.30.0180.00217.12
8.0.20.0100.01017.40
8.0.10.0020.00517.08
8.0.00.0100.00816.61
7.4.330.0000.00514.76
7.4.320.0030.00316.48
7.4.300.0030.00316.50
7.4.290.0070.00016.62
7.4.280.0070.00016.51
7.4.270.0030.00316.38
7.4.260.0000.00613.30
7.4.250.0000.00716.42
7.4.240.0000.00716.44
7.4.230.0050.00316.44
7.4.220.0060.01016.42
7.4.210.0090.00716.48
7.4.200.0070.00016.30
7.4.190.0070.00016.48
7.4.160.0100.00616.51
7.4.150.0100.00717.40
7.4.140.0030.01517.86
7.4.130.0060.01016.55
7.4.120.0090.00816.48
7.4.110.0100.00716.46
7.4.100.0180.00416.66
7.4.90.0150.00416.53
7.4.80.0100.01019.37
7.4.70.0130.00916.59
7.4.60.0030.01316.51
7.4.50.0030.00316.53
7.4.40.0060.00622.27
7.4.30.0030.01316.54
7.4.10.0110.00714.91
7.4.00.0070.01114.81
7.3.330.0050.00013.16
7.3.320.0030.00313.16
7.3.310.0000.00716.25
7.3.300.0000.00616.11
7.3.290.0000.01416.23
7.3.280.0040.01316.34
7.3.270.0090.00817.40
7.3.260.0100.01018.24
7.3.250.0070.01316.44
7.3.240.0030.01316.30
7.3.230.0110.01116.71
7.3.210.0060.01616.57
7.3.200.0140.00519.39
7.3.190.0090.01216.66
7.3.180.0160.00016.40
7.3.170.0060.00916.27
7.3.160.0070.01016.35
7.3.130.0060.01314.63
7.3.120.0060.01014.90
7.3.110.0110.00614.87
7.3.100.0070.00814.89
7.3.90.0080.00814.95
7.3.80.0080.00814.88
7.3.70.0090.00714.93
7.3.60.0030.01014.72
7.3.50.0050.00914.64
7.3.40.0070.00514.78
7.3.30.0070.00514.64
7.3.20.0050.00816.49
7.3.10.0060.00916.63
7.3.00.0060.00916.60
7.2.330.0030.01416.63
7.2.320.0100.00716.45
7.2.310.0210.00316.66
7.2.300.0030.01316.73
7.2.290.0120.00616.63
7.2.260.0040.01415.05
7.2.250.0110.00515.27
7.2.240.0060.00915.07
7.2.230.0050.01215.19
7.2.220.0070.01014.93
7.2.210.0110.00414.93
7.2.200.0090.00514.96
7.2.190.0080.00515.03
7.2.180.0010.01114.92
7.2.170.0060.00715.13
7.2.160.0120.00314.90
7.2.150.0060.00916.86
7.2.140.0070.00716.78
7.2.130.0130.01016.83
7.2.120.0040.00916.75
7.2.110.0050.01016.95
7.2.100.0060.00816.96
7.2.90.0040.00816.98
7.2.80.0080.00616.83
7.2.70.0070.00716.93
7.2.60.0070.00616.97
7.2.50.0070.00517.02
7.2.40.0060.00616.90
7.2.30.0100.00216.96
7.2.20.0070.00716.95
7.2.10.0080.00716.80
7.2.00.0060.00816.86
7.1.330.0050.00915.93
7.1.320.0090.00415.70
7.1.310.0050.00815.86
7.1.300.0080.00615.71
7.1.290.0070.00515.84
7.1.280.0080.01015.94
7.1.270.0100.00615.65
7.1.260.0060.00515.80
7.1.250.0050.00915.59
7.1.240.0090.00615.96
7.1.230.0040.00715.74
7.1.220.0040.00915.88
7.1.210.0060.00515.73
7.1.200.0070.00615.81
7.1.190.0050.00715.78
7.1.180.0070.00715.81
7.1.170.0060.00815.88
7.1.160.0030.00915.81
7.1.150.0090.00315.86
7.1.140.0030.00915.79
7.1.130.0060.00615.95
7.1.120.0060.00615.71
7.1.110.0060.00715.83
7.1.100.0120.00315.92
7.1.90.0040.00615.78
7.1.80.0090.00315.74
7.1.70.0030.01016.19
7.1.60.0070.01016.72
7.1.50.0070.00816.02
7.1.40.0080.00315.67
7.1.30.0070.00515.74
7.1.20.0080.00515.88
7.1.10.0080.00415.95
7.1.00.0030.01617.40
7.0.330.0070.00715.32
7.0.320.0060.00715.23
7.0.310.0080.00515.27
7.0.300.0080.00515.27
7.0.290.0070.00615.36
7.0.280.0060.00915.37
7.0.270.0080.00715.36
7.0.260.0070.00715.47
7.0.250.0040.00815.40
7.0.240.0060.00815.44
7.0.230.0070.00815.36
7.0.220.0040.01015.37
7.0.210.0070.00815.34
7.0.200.0220.00715.21
7.0.190.0060.00615.50
7.0.180.0070.00515.27
7.0.170.0090.00615.42
7.0.160.0060.00615.42
7.0.150.0040.00915.48
7.0.140.0040.02517.14
7.0.130.0050.00815.47
7.0.120.0050.00615.41
7.0.110.0050.01015.38
7.0.100.0080.00515.51
7.0.90.0060.00915.38
7.0.80.0190.02116.65
7.0.70.0180.02516.62
7.0.60.0160.02516.51
7.0.50.0200.02216.66
7.0.40.0050.02615.15
7.0.30.0060.01915.13
7.0.20.0090.02215.02
7.0.10.0020.02715.13
7.0.00.0080.01615.10
5.6.400.0060.00614.58
5.6.390.0000.01314.69
5.6.380.0060.00814.11
5.6.370.0050.00914.45
5.6.360.0040.00814.47
5.6.350.0080.00414.56
5.6.340.0050.00914.35
5.6.330.0050.00914.41
5.6.320.0050.00814.35
5.6.310.0050.00514.35
5.6.300.0080.00514.61
5.6.290.0080.00414.58
5.6.280.0050.02515.96
5.6.270.0070.00714.37
5.6.260.0000.00914.15
5.6.250.0060.00614.31
5.6.240.0080.00614.40
5.6.230.0100.02115.96
5.6.220.0090.01316.06
5.6.210.0070.02216.02
5.6.200.0070.02615.99
5.6.190.0070.02516.06
5.6.180.0060.02016.10
5.6.170.0090.02116.05
5.6.160.0060.02716.08
5.6.150.0030.02716.06
5.6.140.0090.02316.00
5.6.130.0040.02716.15
5.6.120.0040.03016.01
5.6.110.0070.02416.11
5.6.100.0060.02716.07
5.6.90.0060.02616.07
5.6.80.0070.01715.89
5.6.70.0070.02515.89
5.6.60.0070.02415.96
5.6.50.0030.02615.81
5.6.40.0110.02115.77
5.6.30.0050.02515.97
5.6.20.0070.02415.77
5.6.10.0050.02115.79
5.6.00.0050.02215.75
5.5.380.0040.00412.23
5.5.370.0050.02614.30
5.5.360.0050.02414.22
5.5.350.0010.03014.21
5.5.340.0060.01814.52
5.5.330.0050.02514.38
5.5.320.0030.02714.39
5.5.310.0060.02614.43
5.5.300.0090.02214.38
5.5.290.0010.02514.47
5.5.280.0050.01914.45
5.5.270.0050.02414.46
5.5.260.0080.02214.46
5.5.250.0050.02314.41
5.5.240.0060.02114.21
5.5.230.0030.02714.26
5.5.220.0060.02414.18
5.5.210.0040.01814.18
5.5.200.0050.02314.13
5.5.190.0080.02214.24
5.5.180.0030.02514.19
5.5.170.0050.00613.22
5.5.160.0070.01714.26
5.5.150.0060.02314.17
5.5.140.0120.02214.14
5.5.130.0060.02214.33
5.5.120.0060.02414.16
5.5.110.0020.02814.24
5.5.100.0040.02614.16
5.5.90.0140.01714.13
5.5.80.0040.02414.25
5.5.70.0050.01714.25
5.5.60.0040.02014.19
5.5.50.0060.01714.28
5.5.40.0040.02614.14
5.5.30.0080.01614.20
5.5.20.0100.02314.14
5.5.10.0030.02514.26
5.5.00.0030.01914.11
5.4.450.0070.02313.05
5.4.440.0050.02113.10
5.4.430.0040.02413.07
5.4.420.0080.01813.05
5.4.410.0040.01913.06
5.4.400.0030.01713.03
5.4.390.0030.02513.05
5.4.380.0060.02213.01
5.4.370.0040.02413.09
5.4.360.0060.02513.00
5.4.350.0070.02013.03
5.4.340.0050.02113.05
5.4.330.0040.00510.94
5.4.320.0030.01513.03
5.4.310.0050.02313.02
5.4.300.0050.02512.97
5.4.290.0060.01912.99
5.4.280.0080.01812.98
5.4.270.0050.02313.07
5.4.260.0070.01513.02
5.4.250.0060.02112.98
5.4.240.0070.02113.06
5.4.230.0050.01413.02
5.4.220.0050.02413.06
5.4.210.0080.02013.02
5.4.200.0090.02113.03
5.4.190.0040.02513.09
5.4.180.0040.02213.00
5.4.170.0060.01512.97
5.4.160.0060.02113.02
5.4.150.0050.01312.99
5.4.140.0070.01212.34
5.4.130.0060.01312.37
5.4.120.0090.00912.33
5.4.110.0070.01012.37
5.4.100.0080.01112.36
5.4.90.0080.00912.34
5.4.80.0040.01412.35
5.4.70.0070.01212.28
5.4.60.0050.01312.35
5.4.50.0040.02212.28
5.4.40.0050.02112.29
5.4.30.0060.01512.35
5.4.20.0040.02412.39
5.4.10.0010.02412.29
5.4.00.0010.01512.21
5.3.290.0030.02411.80
5.3.280.0060.01911.78
5.3.270.0070.02211.71
5.3.260.0060.01211.80
5.3.250.0050.01911.77
5.3.240.0050.01311.78
5.3.230.0020.01711.79
5.3.220.0020.01511.73
5.3.210.0000.01811.77
5.3.200.0070.01011.74
5.3.190.0040.01411.76
5.3.180.0060.01311.79
5.3.170.0060.01211.78
5.3.160.0040.01111.81
5.3.150.0040.02011.78
5.3.140.0040.01911.79
5.3.130.0040.01911.75
5.3.120.0060.01711.80
5.3.110.0050.02011.77
5.3.100.0050.01111.67
5.3.90.0060.01711.61
5.3.80.0040.01611.64
5.3.70.0040.01311.64
5.3.60.0060.01511.66
5.3.50.0040.01611.58
5.3.40.0040.01911.58
5.3.30.0040.01311.62
5.3.20.0040.01411.52
5.3.10.0040.01311.48
5.3.00.0060.01111.48
5.2.170.0030.01311.31
5.2.160.0030.01211.31
5.2.150.0070.00811.31
5.2.140.0020.01911.31
5.2.130.0030.02011.31
5.2.120.0010.01311.31
5.2.110.0060.01011.31
5.2.100.0050.01211.31
5.2.90.0060.02111.31
5.2.80.0040.01811.31
5.2.70.0070.01211.31
5.2.60.0060.01011.31
5.2.50.0060.01111.31
5.2.40.0060.01011.31
5.2.30.0060.01011.31
5.2.20.0040.01411.31
5.2.10.0030.01211.31
5.2.00.0040.01111.31
5.1.60.0080.00911.31
5.1.50.0070.01611.31
5.1.40.0050.00911.31
5.1.30.0020.01211.31
5.1.20.0030.01211.31
5.1.10.0020.01111.31
5.1.00.0060.00911.31
5.0.50.0050.00611.31
5.0.40.0030.01311.31
5.0.30.0030.02011.31
5.0.20.0020.00711.31
5.0.10.0020.00911.31
5.0.00.0010.01411.31
4.4.90.0020.00811.31
4.4.80.0010.01411.31
4.4.70.0020.00711.31
4.4.60.0020.00711.31
4.4.50.0040.00511.31
4.4.40.0020.01211.31
4.4.30.0020.00811.31
4.4.20.0050.00611.31
4.4.10.0010.00811.31
4.4.00.0020.01011.31
4.3.110.0060.00411.31
4.3.100.0040.00611.31
4.3.90.0020.00811.31
4.3.80.0040.00811.31
4.3.70.0010.01011.31
4.3.60.0060.00411.31
4.3.50.0020.00811.31
4.3.40.0020.01111.31
4.3.30.0010.00811.31
4.3.20.0040.00611.31
4.3.10.0010.00911.31
4.3.00.0030.00611.31

preferences:
54.43 ms | 401 KiB | 5 Q