3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @param array $array * @param string $column * * @return array */ function mergeOnEquals(array $array, $column) { $result = []; foreach ($array as $subArray) { $index = $subArray[$column]; if (isset($result[$index])) { foreach($subArray as $key => $value) { if (!isset($result[$index][$key])) { $result[$index][$key] = $value; } elseif ($result[$index][$key] != $value) { $result[$index][$key] .= ",$value"; } } } else { $result[$index] = $subArray; } } return array_values($result); } $array = [ [ 'carriertype' => null, 'radiotype' => 'RRUS 12 B2', 'serialnumber' => 'CF82943634', 'market' => 'Detroit Westland - DET 5', 'bts' => 225011, 'Host' => '225011_21_MILE_and_ROMEO_PLANK', 'resourceId' => 0, 'type' => 'XMU', 'port' => 16, 'EP_AuxPlugInUnit_AuxPlugInUnitId' => 'RRU-7', 'userlabletext' => '225011_1_4', 'flag' => 'Yes', ], [ 'carriertype' => null, 'radiotype' => 'RRUS 12 B2', 'serialnumber' => 'CF82961338', 'market' => 'Detroit Westland - DET 5', 'bts' => 225011, 'Host' => '225011_21_MILE_and_ROMEO_PLANK', 'resourceId' => 0, 'type' => 'XMU', 'port' => 15, 'EP_AuxPlugInUnit_AuxPlugInUnitId' => 'RRU-8', 'userlabletext' => '225011_2_4', 'flag' => 'Yes', ], [ 'carriertype' => null, 'radiotype' => 'RRUS 12 B2', 'serialnumber' => 'CF82943628', 'market' => 'Detroit Westland - DET 5', 'bts' => '225011', 'Host' => '225011_21_MILE_and_ROMEO_PLANK', 'resourceId' => 0, 'type' => 'XMU', 'port' => 14, 'EP_AuxPlugInUnit_AuxPlugInUnitId' => 'RRU-9', 'userlabletext' => '225011_3_4', 'flag' => 'Yes', ], [ 'radiotype' => null, 'carriertype' => null, 'serialnumber' => null, 'market' => 'Detroit Westland - DET 5', 'bts' => 225011, 'Host' => '225011_21_MILE_and_ROMEO_PLANK', 'resourceId' => 0, 'type' => 'XMU', 'port' => 1, 'EP_AuxPlugInUnit_AuxPlugInUnitId' => null, 'userlabletext' => '___B', 'flag' => 'Yes', ], [ 'radiotype' => null, 'carriertype' => null, 'serialnumber' => null, 'market' => 'Detroit Westland - DET 5', 'bts' => 225011, 'Host' => '225011_21_MILE_and_ROMEO_PLANK', 'resourceId' => 0, 'type' => 'XMU', 'port' => 1, 'EP_AuxPlugInUnit_AuxPlugInUnitId' => null, 'userlabletext' => '___E', 'flag' => 'Yes', ], [ 'carriertype' => 'AWS', 'radiotype' => 'RRUS 12 B4', 'serialnumber' => 'CF81666912', 'market' => 'Detroit Westland - DET 5', 'bts' => 225011, 'Host' => '225011_21_MILE_and_ROMEO_PLANK', 'resourceId' => 0, 'type' => 'XMU', 'port' => 16, 'EP_AuxPlugInUnit_AuxPlugInUnitId' => 'RRU-5', 'userlabletext' => '225011_2_2', 'flag' => 'Yes', ], [ 'carriertype' => 'AWS', 'radiotype' => 'RRUS 12 B4', 'serialnumber' => 'CF81666918', 'market' => 'Detroit Westland - DET 5', 'bts' => 225011, 'Host' => '225011_21_MILE_and_ROMEO_PLANK', 'resourceId' => 0, 'type' => 'XMU', 'port' => 14, 'EP_AuxPlugInUnit_AuxPlugInUnitId' => 'RRU-6', 'userlabletext' => '225011_3_2', 'flag' => 'Yes', ], ]; print_r(mergeOnEquals($array, 'port'));

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.0110.00716.50
8.3.50.0100.01021.27
8.3.40.0120.00319.02
8.3.30.0120.00318.71
8.3.20.0050.00318.82
8.3.10.0040.00421.52
8.3.00.0030.00621.73
8.2.180.0110.00418.28
8.2.170.0090.00622.96
8.2.160.0070.00720.38
8.2.150.0030.00624.18
8.2.140.0000.00724.66
8.2.130.0050.00319.51
8.2.120.0040.00426.35
8.2.110.0040.00719.95
8.2.100.0060.00618.03
8.2.90.0080.00017.75
8.2.80.0030.00618.80
8.2.70.0000.00817.75
8.2.60.0000.00817.63
8.2.50.0060.00317.50
8.2.40.0040.00418.12
8.2.30.0070.00018.15
8.2.20.0050.00218.14
8.2.10.0000.00718.03
8.2.00.0000.00817.74
8.1.280.0140.00725.92
8.1.270.0040.00423.87
8.1.260.0070.00328.09
8.1.250.0040.00428.09
8.1.240.0080.00323.96
8.1.230.0060.00622.87
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0050.00317.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0030.00518.54
8.1.160.0020.00518.88
8.1.150.0000.00818.90
8.1.140.0000.00719.64
8.1.130.0030.00317.79
8.1.120.0050.00317.45
8.1.110.0040.00317.41
8.1.100.0040.00417.45
8.1.90.0000.00817.51
8.1.80.0050.00217.51
8.1.70.0050.00217.40
8.1.60.0040.00417.52
8.1.50.0000.00817.44
8.1.40.0000.01117.51
8.1.30.0060.00317.65
8.1.20.0030.00617.67
8.1.10.0000.01117.51
8.1.00.0030.00617.43
8.0.300.0040.00418.77
8.0.290.0030.00616.63
8.0.280.0000.00718.32
8.0.270.0040.00416.80
8.0.260.0000.00717.36
8.0.250.0030.00316.97
8.0.240.0000.00716.95
8.0.230.0080.00016.96
8.0.220.0000.00716.89
8.0.210.0070.00016.89
8.0.200.0060.00017.01
8.0.190.0000.00816.97
8.0.180.0030.00616.83
8.0.170.0040.00416.90
8.0.160.0050.00216.96
8.0.150.0040.00416.80
8.0.140.0000.00716.84
8.0.130.0030.00313.43
8.0.120.0050.00316.97
8.0.110.0000.00716.82
8.0.100.0070.00016.81
8.0.90.0070.00016.80
8.0.80.0150.00916.97
8.0.70.0000.00716.76
8.0.60.0040.00416.83
8.0.50.0040.00416.99
8.0.30.0110.01116.91
8.0.20.0180.00917.40
8.0.10.0070.00017.16
8.0.00.0060.01317.00
7.4.330.0050.00215.55
7.4.320.0000.00716.49
7.4.300.0000.00716.65
7.4.290.0070.00016.66
7.4.280.0040.00416.66
7.4.270.0000.00716.64
7.4.260.0080.00016.61
7.4.250.0030.00316.60
7.4.240.0040.00416.62
7.4.230.0030.00316.61
7.4.220.0130.00316.46
7.4.210.0090.00616.57
7.4.200.0050.00316.46
7.4.160.0120.00516.54
7.4.150.0090.00917.40
7.4.140.0120.00817.86
7.4.130.0020.01616.74
7.4.120.0100.00716.48
7.4.110.0080.00816.59
7.4.100.0090.01016.59
7.4.90.0040.01316.55
7.4.80.0130.00319.39
7.4.70.0080.00816.61
7.4.60.0100.01016.48
7.4.50.0060.00916.60
7.4.40.0130.00316.47
7.4.30.0080.00816.64
7.4.00.0100.00314.89
7.3.330.0030.00513.25
7.3.320.0030.00313.35
7.3.310.0060.00316.38
7.3.300.0030.00316.26
7.3.290.0090.00716.36
7.3.280.0070.01116.39
7.3.270.0000.01617.40
7.3.260.0050.01216.52
7.3.250.0120.00516.42
7.3.240.0100.00716.55
7.3.230.0080.00916.39
7.3.210.0090.00916.56
7.3.200.0030.01416.35
7.3.190.0160.00016.67
7.3.180.0070.01016.34
7.3.170.0120.00916.40
7.3.160.0060.01516.49
7.3.10.0080.00416.51
7.3.00.0050.00916.67
7.2.330.0060.01216.88
7.2.320.0070.01116.78
7.2.310.0110.00816.52
7.2.300.0030.01316.81
7.2.290.0170.00716.60
7.2.130.0060.00816.72
7.2.120.0050.00616.99
7.2.110.0540.00616.71
7.2.100.0050.00816.90
7.2.90.0030.01017.02
7.2.80.0060.00617.18
7.2.70.0030.01016.95
7.2.60.0060.00916.93
7.2.50.0090.00516.99
7.2.40.0060.00717.05
7.2.30.0050.01016.88
7.2.20.0090.00516.98
7.2.10.0060.00816.97
7.2.00.0050.00717.78
7.1.250.0060.00615.89
7.1.200.0060.00615.84
7.1.70.0160.00017.18
7.1.60.0060.00617.25
7.1.00.0030.07722.31
7.0.200.0260.00715.03
7.0.120.0500.06320.35
7.0.110.0730.06020.24
7.0.100.0300.05720.26
7.0.90.0270.06020.27
7.0.80.0270.06320.27
7.0.70.0470.06020.34
7.0.60.0600.05020.16
7.0.50.0530.06020.30
7.0.40.0500.06020.38
7.0.30.0400.06320.38
7.0.20.0530.05320.35
7.0.10.0600.04720.22
7.0.00.0370.06720.29
5.6.270.0200.05020.91
5.6.260.0170.05321.01
5.6.250.0230.04721.11
5.6.240.0100.06321.04
5.6.230.0130.06320.89
5.6.220.0170.05320.75
5.6.210.0170.05320.99
5.6.200.0130.05720.78
5.6.190.0100.06021.02
5.6.180.0100.06320.83
5.6.170.0170.07320.84
5.6.160.0100.06320.99
5.6.150.0030.07020.77
5.6.140.0200.05321.03
5.6.130.0170.05321.06
5.6.120.0100.06320.95
5.6.110.0130.06020.85
5.6.100.0130.06020.80
5.6.90.0100.05720.93
5.6.80.0070.06320.43
5.6.70.0100.05720.20
5.6.60.0070.06020.13
5.6.50.0130.05320.43
5.6.40.0200.05020.42
5.6.30.0200.05020.47
5.6.20.0100.06020.37
5.6.10.0130.05720.37
5.6.00.0130.05320.21

preferences:
63.38 ms | 401 KiB | 5 Q