3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ ['id'=> 1,'name'=>'John Sena', 'lastname'=>'Jonn'], ['id'=> 2,'name'=>'Rock', 'lastname'=>'Rock Sena'] ]; $array2 = [ ['id'=>1, 'company'=>'Warner Brother'], ['id'=>2, 'company'=>'Metro'],['id'=>'1', 'Address'=>'USA'] ]; foreach ($array2 as $a2) { foreach ($array1 as &$a1) { if ($a2['id'] == $a1['id']) { $a1 = array_merge($a1, $a2); } } } print_r($array1);

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.0080.01517.41
8.4.120.0060.00620.61
8.4.110.0090.00818.71
8.4.100.0040.00617.80
8.4.90.0050.00620.44
8.4.80.0080.00818.84
8.4.70.0130.00718.91
8.4.60.0140.00620.54
8.4.50.0100.01118.69
8.4.40.0090.00019.66
8.4.30.0090.00917.63
8.4.20.0090.00619.69
8.4.10.0030.00617.79
8.3.260.0050.00416.48
8.3.250.0110.00817.11
8.3.240.0130.00616.47
8.3.230.0100.00916.55
8.3.220.0070.00518.71
8.3.210.0030.00616.68
8.3.200.0030.00616.63
8.3.190.0090.00617.00
8.3.180.0120.00618.70
8.3.170.0090.00917.28
8.3.160.0170.00318.22
8.3.150.0150.00416.41
8.3.140.0040.00416.52
8.3.130.0080.00818.34
8.3.120.0060.00319.00
8.3.110.0080.00020.94
8.3.100.0030.00624.06
8.3.90.0000.01526.77
8.3.80.0090.00016.43
8.3.70.0150.00016.58
8.3.60.0200.00016.50
8.3.50.0100.01017.35
8.3.40.0070.00718.71
8.3.30.0120.00318.76
8.3.20.0080.00019.16
8.3.10.0040.00421.82
8.3.00.0040.00423.42
8.2.290.0090.01018.77
8.2.280.0130.00618.26
8.2.270.0110.00416.81
8.2.260.0070.00716.91
8.2.250.0050.00316.59
8.2.240.0090.00917.18
8.2.230.0030.00522.58
8.2.220.0040.00437.54
8.2.210.0060.00326.77
8.2.200.0040.00416.50
8.2.190.0120.00416.58
8.2.180.0120.00316.75
8.2.170.0160.00422.96
8.2.160.0100.01019.08
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0070.00026.16
8.2.120.0000.00721.13
8.2.110.0060.00322.19
8.2.100.0090.00318.03
8.2.90.0000.00818.03
8.2.80.0000.00819.16
8.2.70.0040.00417.63
8.2.60.0030.00617.75
8.2.50.0080.00017.63
8.2.40.0020.00519.36
8.2.30.0000.00719.31
8.2.20.0030.00518.00
8.2.10.0070.00019.44
8.2.00.0030.00319.47
8.1.330.0100.00918.56
8.1.320.0130.00617.89
8.1.310.0040.00418.30
8.1.300.0070.00319.52
8.1.290.0080.00030.84
8.1.280.0120.00325.92
8.1.270.0150.00320.32
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0030.00623.98
8.1.230.0040.00721.03
8.1.220.0000.00817.76
8.1.210.0040.00418.77
8.1.200.0050.00317.35
8.1.190.0050.00317.36
8.1.180.0090.00018.10
8.1.170.0040.00418.90
8.1.160.0070.00018.90
8.1.150.0000.00718.80
8.1.140.0040.00417.87
8.1.130.0080.00018.96
8.1.120.0000.00717.36
8.1.110.0030.00617.34
8.1.100.0000.00717.46
8.1.90.0040.00417.39
8.1.80.0000.00817.50
8.1.70.0030.00517.37
8.1.60.0040.00417.61
8.1.50.0040.00417.51
8.1.40.0040.00417.57
8.1.30.0080.00017.57
8.1.20.0000.00817.66
8.1.10.0040.00417.52
8.1.00.0000.00817.32
8.0.300.0000.00719.84
8.0.290.0050.00216.75
8.0.280.0000.00718.45
8.0.270.0000.00716.73
8.0.260.0000.00617.10
8.0.250.0030.00416.87
8.0.240.0060.00016.98
8.0.230.0070.00016.80
8.0.220.0070.00016.79
8.0.210.0070.00016.90
8.0.200.0000.00716.91
8.0.190.0000.00716.82
8.0.180.0030.00316.95
8.0.170.0030.00616.79
8.0.160.0030.00516.90
8.0.150.0000.00716.70
8.0.140.0050.00216.71
8.0.130.0000.00613.31
8.0.120.0000.00716.86
8.0.110.0000.00816.90
8.0.100.0000.00716.85
8.0.90.0040.00416.95
8.0.80.0100.01016.89
8.0.70.0040.00416.78
8.0.60.0070.00016.93
8.0.50.0030.00516.93
8.0.30.0080.01117.12
8.0.20.0150.00517.40
8.0.10.0080.00016.87
8.0.00.0090.01016.81
7.4.330.0020.00215.55
7.4.320.0070.00016.60
7.4.300.0000.00716.52
7.4.290.0030.00316.52
7.4.280.0050.00516.50
7.4.270.0100.00016.48
7.4.260.0030.00316.48
7.4.250.0000.00716.55
7.4.240.0030.00316.41
7.4.230.0000.00716.59
7.4.220.0000.00716.38
7.4.210.0080.00916.66
7.4.200.0070.00016.44
7.4.140.0120.00817.86
7.4.130.0110.00716.49
7.4.120.0110.00716.50
7.4.110.0060.01216.59
7.4.100.0030.01316.41
7.4.90.0030.01516.50
7.4.80.0120.00619.39
7.4.70.0030.01616.64
7.4.60.0060.01016.64
7.4.50.0060.00916.61
7.4.40.0080.01516.40
7.4.00.0080.00914.94
7.3.330.0050.00013.02
7.3.320.0000.00613.17
7.3.310.0070.00016.29
7.3.300.0000.00616.34
7.3.290.0000.00716.22
7.3.280.0100.00816.30
7.3.260.0100.00816.54
7.3.240.0080.01216.49
7.3.230.0070.01116.25
7.3.210.0080.01016.28
7.3.200.0090.00616.52
7.3.190.0040.01116.22
7.3.180.0120.00416.47
7.3.170.0140.00716.58
7.3.160.0140.00316.53
7.3.120.0040.01514.82
7.3.110.0130.00314.94
7.3.100.0070.01114.80
7.3.90.0070.00414.81
7.3.80.0030.00714.59
7.3.70.0120.00014.70
7.3.60.0040.00814.66
7.3.50.0030.00914.64
7.3.40.0000.00914.68
7.3.30.0030.01214.95
7.3.20.0000.01116.69
7.3.10.0160.00016.41
7.3.00.0060.00616.79
7.2.330.0080.01016.52
7.2.320.0110.00716.71
7.2.310.0090.00916.65
7.2.300.0130.00716.59
7.2.290.0130.00316.61
7.2.250.0100.01014.68
7.2.240.0000.02115.17
7.2.230.0000.01615.05
7.2.220.0050.00814.90
7.2.210.0090.00314.51
7.2.200.0060.00615.09
7.2.190.0030.00715.05
7.2.180.0030.01214.96
7.2.170.0030.01315.25
7.2.80.0170.00714.94
7.2.70.0170.01215.00
7.2.60.0160.01614.96
7.2.50.0190.00914.90
7.2.40.0130.01315.25
7.2.30.0280.00315.02
7.2.20.0220.00315.09
7.2.10.0160.00915.23
7.2.00.0190.00614.88
7.1.330.0030.01015.55
7.1.320.0030.00616.10
7.1.310.0040.01115.70
7.1.300.0030.01115.69
7.1.290.0090.00315.80
7.1.280.0000.01315.85
7.1.270.0030.00615.85
7.1.260.0000.01415.81
7.1.200.0120.00315.87
7.1.190.0170.00913.84
7.1.180.1140.00713.83
7.1.170.0100.01314.04
7.1.160.0130.01313.75
7.1.150.0130.01013.72
7.1.140.0180.00613.91
7.1.130.0240.01013.94
7.1.120.0170.00713.71
7.1.110.0100.01313.86
7.1.100.0160.01013.50
7.1.90.0200.00613.92
7.1.80.0250.00913.85
7.1.70.0190.00813.55
7.1.60.0370.00731.84
7.1.50.0330.01331.79
7.1.40.0360.01031.90
7.1.30.0350.02031.96
7.1.20.0360.01031.79
7.1.10.0130.01313.55
7.1.00.0180.00614.10

preferences:
27.87 ms | 403 KiB | 5 Q