3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 1649 => ["firstName" => "jack", "lastName" => "straw"], 1650 => ["firstName" => "jack", "lastName" => "straw"], 1651 => ["firstName" => "jack", "lastName" => "straw"], 1652 => ["firstName" => "jack", "lastName" => "straw"], 1653 => ["firstName" => "jack1", "lastName" => "straw"], 1654 => ["firstName" => "jack1", "lastName" => "straw"] ]; foreach ($array as $key => &$row) { $compositeKey = $row['firstName'] . '-' . $row['firstName']; if (!isset($ref[$compositeKey])) { $ref[$compositeKey] = &$row; } else { $ref[$compositeKey]['mergedWith'][] = $key; unset($array[$key]); } } var_export($array);

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.140.0090.01117.52
8.4.130.0140.00618.03
8.4.120.0110.00920.67
8.4.110.0050.00522.34
8.4.100.0040.00517.49
8.4.90.0140.00718.63
8.4.80.0110.01019.51
8.4.70.0050.00417.81
8.4.60.0120.00818.83
8.4.50.0120.00722.57
8.4.40.0000.00820.57
8.4.30.0090.00624.04
8.4.20.0100.01019.41
8.4.10.0140.00722.02
8.3.270.0120.00916.63
8.3.260.0130.00716.30
8.3.250.0110.00818.83
8.3.240.0100.01016.75
8.3.230.0080.00516.69
8.3.220.0120.00717.03
8.3.210.0140.00616.61
8.3.200.0050.00416.58
8.3.190.0120.00617.05
8.3.180.0080.00718.08
8.3.170.0070.01117.25
8.3.160.0070.01118.46
8.3.150.0070.01117.12
8.3.140.0040.00717.18
8.3.130.0000.01018.50
8.3.120.0040.00820.98
8.3.110.0000.01120.94
8.3.100.0030.00624.06
8.3.90.0030.00526.77
8.3.80.0030.00618.55
8.3.70.0090.00618.43
8.3.60.0110.00316.63
8.3.50.0110.00416.72
8.3.40.0040.01523.47
8.3.30.0160.00018.68
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0090.00026.16
8.2.290.0110.00720.25
8.2.280.0120.00418.66
8.2.270.0060.01317.27
8.2.260.0030.01216.50
8.2.250.0140.00418.38
8.2.240.0000.00817.26
8.2.230.0030.00622.58
8.2.220.0030.00737.54
8.2.210.0050.00326.77
8.2.200.0050.00516.63
8.2.190.0080.00816.75
8.2.180.0120.00316.50
8.2.170.0160.00618.95
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00419.66
8.2.110.0000.00922.25
8.2.100.0080.00417.84
8.2.90.0040.00417.88
8.2.80.0040.00418.73
8.2.70.0000.00817.75
8.2.60.0150.00417.00
8.2.50.0130.00417.50
8.2.40.0170.00017.74
8.2.30.0160.00017.50
8.2.20.0130.00417.38
8.2.10.0150.00317.50
8.2.00.0130.00417.38
8.1.330.0040.00421.98
8.1.320.0080.01116.13
8.1.310.0040.00418.48
8.1.300.0090.00016.50
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.14
8.1.230.0060.00619.18
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00617.35
8.1.190.0140.00316.88
8.1.180.0090.00917.00
8.1.170.0140.00417.38
8.1.160.0200.00017.13
8.1.150.0200.00017.00
8.1.140.0110.00817.00
8.1.130.0130.00517.25
8.1.120.0160.00317.25
8.1.110.0100.00717.23
8.1.100.0190.00217.38
8.1.90.0140.00217.38
8.1.80.0110.00516.99
8.1.70.0160.00017.23
8.1.60.0100.00817.47
8.1.50.0140.00317.25
8.1.40.0120.00617.48
8.1.30.0040.01317.25
8.1.20.0120.00617.38
8.1.10.0110.00717.25
8.1.00.0090.00917.13
8.0.300.0030.00619.63
8.0.290.0120.00016.58
8.0.280.0130.00916.52
8.0.270.0100.00716.73
8.0.260.0090.00916.52
8.0.250.0000.01716.52
8.0.240.0030.01316.52
8.0.230.0110.00816.63
8.0.220.0180.00016.74
8.0.210.0130.00316.63
8.0.200.0150.00216.52
8.0.190.0080.00816.75
8.0.180.0100.00716.73
8.0.170.0140.00316.59
8.0.160.0160.00016.52
8.0.150.0120.00416.63
8.0.140.0150.00016.52
8.0.130.0120.00416.52
8.0.120.0160.00016.52
8.0.110.0130.00216.52
8.0.100.0100.00716.52
8.0.90.0080.00816.52
8.0.80.0100.00716.52
8.0.70.0170.00016.52
8.0.60.0180.00016.52
8.0.50.0090.00916.52
8.0.30.0160.00016.52
8.0.20.0130.00516.61
8.0.10.0160.00016.62

preferences:
28.45 ms | 403 KiB | 5 Q