3v4l.org

run code in 300+ PHP versions simultaneously
<?php $poorly_merged = [ (object)["id" => "5", "unit" => 1], (object)["id" => "3", "text" => "three"], (object)["id" => "1", "text" => "one"], (object)["id" => "2", "text" => "two"], (object)["id" => "4", "text" => "four"], (object)["id" => "5", "text" => "five"], (object)["id" => "3", "unit" => 0], (object)["id" => "1", "unit" => "0"], (object)["id" => "2", "unit" => 0], (object)["id" => "4", "unit" => "0"] ]; $output = []; foreach ($poorly_merged as $object) { if (!isset($output[$object->id])) { $output[$object->id] = $object; } else { foreach ($object as $property => $value) { $output[$object->id]->{$property} = $value; } } } ksort($output); // optionally order by ids var_export(array_values($output));

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.0120.00618.43
8.3.50.0030.01316.65
8.3.40.0180.00418.75
8.3.30.0070.00718.74
8.3.20.0000.00820.66
8.3.10.0090.00023.66
8.3.00.0030.00518.68
8.2.180.0130.00718.23
8.2.170.0140.00722.96
8.2.160.0100.00320.44
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0060.00320.94
8.2.100.0080.00320.54
8.2.90.0090.00017.84
8.2.80.0070.00318.95
8.2.70.0000.00817.75
8.2.60.0040.00417.75
8.2.50.0080.00017.63
8.2.40.0040.00819.45
8.2.30.0070.00019.36
8.2.20.0040.00418.23
8.2.10.0040.00419.42
8.2.00.0000.00719.36
8.1.280.0060.00825.92
8.1.270.0070.00422.14
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0100.00019.12
8.1.230.0040.00720.89
8.1.220.0040.00417.78
8.1.210.0050.00518.77
8.1.200.0060.00317.23
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0000.00818.57
8.1.160.0040.00418.89
8.1.150.0050.00218.80
8.1.140.0070.00017.50
8.1.130.0070.00020.31
8.1.120.0030.00317.51
8.1.110.0040.00417.38
8.1.100.0050.00317.33
8.1.90.0000.00917.36
8.1.80.0000.00917.50
8.1.70.0050.00217.48
8.1.60.0040.00417.60
8.1.50.0040.00417.45
8.1.40.0080.00017.49
8.1.30.0040.00417.57
8.1.20.0000.00817.66
8.1.10.0120.00517.60
8.1.00.0110.00617.37
8.0.300.0020.00519.65
8.0.290.0030.00516.88
8.0.280.0000.00718.44
8.0.270.0040.00417.18
8.0.260.0000.00620.13
8.0.250.0030.00316.86
8.0.240.0030.00317.03
8.0.230.0000.00716.99
8.0.220.0000.00716.91
8.0.210.0030.00316.94
8.0.200.0000.00716.88
8.0.190.0000.00717.01
8.0.180.0000.00816.98
8.0.170.0000.00916.94
8.0.160.0030.00316.87
8.0.150.0040.00416.95
8.0.140.0040.00816.93
8.0.130.0070.00515.05
8.0.120.0050.00916.95
8.0.110.0080.00516.98
8.0.100.0060.00816.84
8.0.90.0090.00416.90
8.0.80.0100.00716.96
8.0.70.0090.00516.93
8.0.60.0080.00616.79
8.0.50.0090.00416.87
8.0.30.0140.00717.11
8.0.20.0100.00916.96
8.0.10.0100.00317.07
8.0.00.0070.00816.92
7.4.330.0000.00515.55
7.4.320.0060.00016.53
7.4.300.0030.00316.46
7.4.290.0000.00716.60
7.4.280.0040.00416.45
7.4.270.0060.00516.46
7.4.260.0130.00014.82
7.4.250.0090.00616.45
7.4.240.0090.00316.55
7.4.230.0090.00516.42
7.4.220.0060.00516.49
7.4.210.0100.00816.56
7.4.200.0110.00216.54
7.4.190.0150.00316.50
7.4.180.0140.00316.61
7.4.160.0160.00216.45
7.4.150.0160.00316.45
7.4.140.0140.00716.48
7.4.130.0140.00516.57
7.4.120.0090.01016.46
7.4.110.0120.00516.35
7.4.100.0150.00416.48
7.4.90.0110.00816.36
7.4.80.0100.00917.86
7.4.70.0090.01116.34
7.4.60.0090.00916.54
7.4.50.0070.00716.44
7.4.40.0120.00516.51
7.4.30.0130.00316.41
7.4.20.0090.00816.34
7.4.10.0110.00516.47
7.4.00.0130.00316.39
7.3.330.0080.00216.36
7.3.320.0070.00414.61
7.3.310.0100.00216.31
7.3.300.0050.00716.34
7.3.290.0100.00516.40
7.3.280.0090.00516.29
7.3.270.0110.00416.27
7.3.260.0100.00816.49
7.3.250.0160.00016.46
7.3.240.0110.00616.39
7.3.230.0170.00316.31
7.3.220.0090.00916.10
7.3.210.0080.00916.47
7.3.200.0120.00816.51
7.3.190.0080.00816.41
7.3.180.0100.00816.35
7.3.170.0090.00816.44
7.3.160.0080.01016.24
7.3.150.0120.00516.40
7.3.140.0150.00216.43
7.3.130.0090.01016.19
7.3.120.0090.00816.34
7.3.110.0080.00916.20
7.3.100.0130.00416.16
7.3.90.0110.00816.38
7.3.80.0100.00616.20
7.3.70.0140.00516.30
7.3.60.0120.00616.39
7.3.50.0130.00816.37
7.3.40.0080.00816.30
7.3.30.0160.00416.31
7.3.20.0090.00917.19
7.3.10.0080.01217.03
7.3.00.0120.00517.23
7.2.340.0180.00016.49
7.2.330.0130.00616.51
7.2.320.0070.00916.40
7.2.310.0130.00516.55
7.2.300.0160.00316.60
7.2.290.0130.00516.59
7.2.280.0150.00316.33
7.2.270.0110.00716.50
7.2.260.0070.01016.56
7.2.250.0090.00916.38
7.2.240.0130.00516.40
7.2.230.0110.00616.28
7.2.220.0080.01016.54
7.2.210.0110.00716.62
7.2.200.0100.00716.49
7.2.190.0100.00816.65
7.2.180.0120.00516.44
7.2.170.0110.00616.57
7.2.160.0130.00716.50
7.2.150.0080.01017.57
7.2.140.0140.00417.46
7.2.130.0140.00517.53
7.2.120.0080.00917.56
7.2.110.0080.00917.46
7.2.100.0070.01017.49
7.2.90.0110.00717.49
7.2.80.0110.00717.46
7.2.70.0160.00317.58
7.2.60.0100.00717.65
7.2.50.0080.00917.44
7.2.40.0110.00617.66
7.2.30.0130.00617.64
7.2.20.0070.01117.56
7.2.10.0080.01117.47
7.2.00.0120.00517.47

preferences:
57.95 ms | 400 KiB | 5 Q