3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => (object) ["class" => 1], 1 => (object) ["class" => 10], ]; $arr1 = [ 0 => (object) ["fee_amount" => 8285], 1 => (object) ["fee_amount" => 300], ]; function multiArrayCombine($array1, $array2) { $temp = array_map(null, $array1, $array2); // switch index wise data on either side foreach ($temp as $key => &$value) { // & to make changes at address of variable $value = json_decode(json_encode($value), true); // convert object to array $value = array_merge(...$value); // removing initial index and merge internally } return json_decode(json_encode($temp)); // convert back to object form } $arr = multiArrayCombine($arr, $arr1); // $arr = array_map(null,...$arr); 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.4.120.0100.01023.84
8.4.110.0050.00523.48
8.4.100.0040.00418.73
8.4.90.0100.00920.44
8.4.80.0130.00718.65
8.4.70.0070.00317.74
8.4.60.0120.00819.00
8.4.50.0100.01018.68
8.4.40.0190.00019.36
8.4.30.0130.01318.66
8.4.20.0120.00920.72
8.4.10.0000.02019.63
8.3.250.0090.00919.10
8.3.240.0130.00717.11
8.3.230.0140.00516.73
8.3.220.0060.00418.93
8.3.210.0120.00816.67
8.3.200.0040.00516.48
8.3.190.0150.00317.32
8.3.180.0090.00317.08
8.3.170.0060.01221.07
8.3.160.0070.01117.08
8.3.150.0130.00617.13
8.3.140.0140.00418.86
8.3.130.0090.00018.40
8.3.120.0040.00420.54
8.3.110.0000.00920.94
8.3.100.0060.00318.65
8.3.90.0110.00426.77
8.3.80.0090.00016.61
8.3.70.0000.01516.75
8.3.60.0100.00718.56
8.3.50.0070.00917.66
8.3.40.0120.00318.79
8.3.30.0070.00718.49
8.3.20.0080.00020.90
8.3.10.0080.00018.98
8.3.00.0000.00721.73
8.2.290.0140.00520.59
8.2.280.0120.00718.33
8.2.270.0110.00716.95
8.2.260.0030.00616.45
8.2.250.0000.01416.59
8.2.240.0060.00318.98
8.2.230.0030.00522.58
8.2.220.0080.00024.06
8.2.210.0030.01026.77
8.2.200.0030.00616.38
8.2.190.0110.00416.63
8.2.180.0110.00725.92
8.2.170.0180.00622.96
8.2.160.0080.00620.57
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0060.00321.14
8.2.100.0080.00418.03
8.2.90.0030.00619.21
8.2.80.0050.00317.97
8.2.70.0040.00417.75
8.2.60.0060.00318.16
8.2.50.0070.00318.07
8.2.40.0040.00418.29
8.2.30.0060.00318.11
8.2.20.0040.00417.99
8.2.10.0000.00818.97
8.2.00.0080.00019.36
8.1.330.0140.00522.09
8.1.320.0120.00816.04
8.1.310.0000.00718.22
8.1.300.0040.01517.76
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0000.01424.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0000.01021.37
8.1.230.0080.00418.97
8.1.220.0040.00417.78
8.1.210.0060.00318.77
8.1.200.0030.00617.36
8.1.190.0000.00917.24
8.1.180.0000.00818.10
8.1.170.0080.00018.84
8.1.160.0000.00818.76
8.1.150.0040.00418.84
8.1.140.0080.00018.80
8.1.130.0070.00020.12
8.1.120.0000.00817.51
8.1.110.0040.00417.37
8.1.100.0070.00017.48
8.1.90.0000.00717.34
8.1.80.0030.00817.32
8.1.70.0040.00417.37
8.1.60.0040.00417.65
8.1.50.0030.00517.48
8.1.40.0030.00617.50
8.1.30.0000.00817.61
8.1.20.0030.00617.60
8.1.10.0040.00417.57
8.1.00.0000.00717.30
8.0.300.0080.00018.90
8.0.290.0070.00016.63
8.0.280.0000.00718.40
8.0.270.0000.00817.31
8.0.260.0000.00618.37
8.0.250.0040.00417.02
8.0.240.0000.00617.07
8.0.230.0030.00417.02
8.0.220.0000.00716.94
8.0.210.0000.00716.87
8.0.200.0000.00716.98
8.0.190.0000.00817.02
8.0.180.0040.00417.05
8.0.170.0000.00916.98
8.0.160.0080.00316.95
8.0.150.0110.00016.87
8.0.140.0040.00416.88
8.0.130.0080.00013.35
8.0.120.0000.00716.88
8.0.110.0000.00816.79
8.0.100.0040.00417.05
8.0.90.0050.00316.80
8.0.80.0060.00916.96
8.0.70.0080.00016.90
8.0.60.0000.00716.85
8.0.50.0000.00716.83
8.0.30.0110.00716.93
8.0.20.0110.01117.26
8.0.10.0000.00716.90
8.0.00.0120.00816.79
7.4.330.0000.00515.55
7.4.320.0060.00016.64
7.4.300.0000.00616.63
7.4.290.0000.00716.59
7.4.280.0040.00416.50
7.4.270.0000.00816.47
7.4.260.0040.00416.48
7.4.250.0050.00316.50
7.4.240.0050.00316.51
7.4.230.0070.00016.39
7.4.220.0000.00816.36
7.4.210.0090.00816.56
7.4.200.0070.00016.36
7.4.160.0090.00816.52
7.4.140.0090.00917.86
7.4.130.0000.01716.66
7.4.120.0050.01116.29
7.4.110.0090.00916.66
7.4.100.0100.00716.41
7.4.90.0130.00616.62
7.4.80.0110.00619.39
7.4.70.0130.00716.58
7.4.60.0120.00616.55
7.4.50.0150.00316.30
7.4.40.0000.01616.48
7.4.20.0150.00316.45
7.4.00.0080.00414.64
7.3.330.0050.00013.31
7.3.320.0060.00013.32
7.3.310.0000.00716.23
7.3.300.0030.00316.37
7.3.290.0030.00316.38
7.3.280.0100.00716.33
7.3.260.0100.00816.50
7.3.240.0100.00616.52
7.3.230.0100.00616.66
7.3.210.0070.01116.28
7.3.200.0110.00716.39
7.3.190.0040.01216.54
7.3.180.0090.00616.47
7.3.170.0060.01516.35
7.3.160.0130.00316.52
7.3.50.0060.01014.86
7.3.40.0050.00514.32
7.3.30.0070.00714.60
7.3.20.0180.00714.48
7.3.10.0070.01114.59
7.3.00.0070.00714.96
7.2.330.0120.00616.67
7.2.320.0100.01316.70
7.2.310.0060.01016.55
7.2.300.0080.00816.72
7.2.290.0030.01616.52
7.2.180.0150.00614.68
7.2.170.0160.00815.01
7.2.160.0140.01514.75
7.2.150.0180.00014.92
7.2.140.0110.00714.73
7.2.130.0150.01514.71
7.2.120.0170.01014.87
7.2.110.0090.01414.86
7.2.100.0140.00914.70
7.2.90.0110.00514.73
7.2.80.0110.00714.89
7.2.70.0190.00914.97
7.2.60.0860.00614.76
7.2.50.0150.01215.10
7.2.40.0210.00914.90
7.2.30.0210.01214.86
7.2.20.0170.00614.85
7.2.10.0140.01214.89
7.2.00.0150.00314.86
7.1.280.0220.00613.75
7.1.270.0100.00713.58
7.1.260.0180.00513.38
7.1.250.0100.00813.72

preferences:
28.08 ms | 403 KiB | 5 Q