3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array ( '0' => Array ( 'emp_firstname' => 'Alistair', 'non_pm' => 'AMZ', 'sum' => 2 ), '1' => Array ( 'emp_firstname' => 'Shakkeer', 'non_pm' => 'SHK', 'sum' => 3 ), '2' => Array ( 'emp_firstname' => 'Waqas', 'non_pm' => 'WAS', 'sum' => 12 ), '3' => Array ( 'emp_firstname' => 'Zain', 'non_pm' => 'ZAI', 'sum' => 9 ), '4' => Array ( 'emp_firstname' => 'Shakkeer', 'gud_pmeditor' => 'SHK', 'sum' => 4 ), '5' => Array ( 'emp_firstname' => 'Zain', 'gud_pmeditor' => 'ZAI', 'sum' => 2 ) ); $res=[]; foreach($arr as $val){ if(array_key_exists($val['emp_firstname'], $res)) $res[$val['emp_firstname']]['sum'] = ($res[$val['emp_firstname']]['sum'] + $val['sum']); else $res[$val['emp_firstname']] = $val; } print_r(array_values($res));

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.130.0000.01518.37
8.3.120.0050.00519.18
8.3.110.0060.00320.94
8.3.100.0030.00618.37
8.3.90.0120.00026.77
8.3.80.0060.00316.50
8.3.70.0090.00916.58
8.3.60.0140.00018.48
8.3.50.0070.01118.48
8.3.40.0070.00718.84
8.3.30.0120.00318.63
8.3.20.0080.00020.77
8.3.10.0090.00019.07
8.3.00.0080.00021.91
8.2.250.0130.00316.82
8.2.240.0060.00317.36
8.2.230.0040.00422.58
8.2.220.0060.00324.06
8.2.210.0110.00326.77
8.2.200.0060.00316.38
8.2.190.0140.00716.63
8.2.180.0090.00925.92
8.2.170.0140.00022.96
8.2.160.0040.01122.31
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0070.00420.52
8.2.110.0030.00721.04
8.2.100.0080.00317.91
8.2.90.0060.00318.03
8.2.80.0000.00818.16
8.2.70.0030.00617.63
8.2.60.0050.00317.50
8.2.50.0030.00517.75
8.2.40.0030.00719.23
8.2.30.0040.00419.30
8.2.20.0000.00718.03
8.2.10.0030.00618.93
8.2.00.0000.00921.27
8.1.300.0060.00320.11
8.1.290.0030.00630.84
8.1.280.0140.00025.92
8.1.270.0040.00422.65
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00021.43
8.1.230.0120.00022.88
8.1.220.0040.00417.74
8.1.210.0080.00018.79
8.1.200.0030.00617.22
8.1.190.0090.00017.35
8.1.180.0050.00418.10
8.1.170.0050.00517.62
8.1.160.0000.00818.89
8.1.150.0040.00418.88
8.1.140.0000.00720.24
8.1.130.0000.00720.16
8.1.120.0040.00417.29
8.1.110.0040.00417.43
8.1.100.0040.00417.43
8.1.90.0050.00317.46
8.1.80.0040.00417.34
8.1.70.0030.00317.43
8.1.60.0060.00317.52
8.1.50.0080.00017.54
8.1.40.0050.00317.52
8.1.30.0040.00417.70
8.1.20.0000.00817.55
8.1.10.0040.00417.46
8.1.00.0000.00817.44
8.0.300.0000.00919.97
8.0.290.0000.00716.75
8.0.280.0000.00818.44
8.0.270.0000.00717.15
8.0.260.0050.00318.44
8.0.250.0030.00317.00
8.0.240.0050.00316.95
8.0.230.0000.00816.83
8.0.220.0070.00016.75
8.0.210.0030.00516.88
8.0.200.0000.00616.83
8.0.190.0040.00416.94
8.0.180.0060.00316.75
8.0.170.0090.00016.84
8.0.160.0050.00316.84
8.0.150.0000.00716.76
8.0.140.0020.00516.75
8.0.130.0030.00313.24
8.0.120.0040.00416.88
8.0.110.0040.00416.69
8.0.100.0000.00716.77
8.0.90.0050.00316.83
8.0.80.0120.00316.93
8.0.70.0040.00416.82
8.0.60.0040.00416.76
8.0.50.0030.00516.83
8.0.30.0070.01016.88
8.0.20.0070.01117.13
8.0.10.0040.00416.79
8.0.00.0100.00816.71
7.4.330.0000.00515.55
7.4.320.0030.00316.48
7.4.300.0000.00616.41
7.4.290.0070.00016.63
7.4.280.0050.00316.63
7.4.270.0060.00616.54
7.4.260.0000.00816.61
7.4.250.0080.00016.39
7.4.240.0000.00816.44
7.4.230.0040.00416.58
7.4.220.0040.00416.47
7.4.210.0100.00616.58
7.4.200.0000.00716.29
7.4.140.0130.01317.86
7.4.130.0160.00016.50
7.4.120.0030.01416.55
7.4.110.0090.00916.43
7.4.100.0070.01016.59
7.4.90.0130.00316.49
7.4.80.0080.00819.39
7.4.70.0030.01316.51
7.4.60.0030.01316.65
7.4.50.0000.01116.25
7.4.40.0040.01116.25
7.4.00.0030.00814.92
7.3.330.0060.00013.07
7.3.320.0050.00013.15
7.3.310.0000.00716.25
7.3.300.0030.00616.30
7.3.290.0000.00716.17
7.3.280.0170.00916.35
7.3.260.0120.00616.41
7.3.240.0120.00816.41
7.3.230.0120.00916.56
7.3.210.0110.00716.59
7.3.200.0030.01716.50
7.3.190.0070.01016.43
7.3.180.0070.01316.35
7.3.170.0080.00816.43
7.3.160.0060.00916.48
7.3.120.0120.00915.03
7.3.110.0070.00714.84
7.3.100.0060.01215.00
7.3.90.0040.01114.55
7.3.80.0060.00914.92
7.3.70.0090.00315.06
7.3.60.0070.01014.99
7.3.50.0120.00514.83
7.3.40.0060.00914.79
7.3.30.0020.01214.87
7.3.20.0080.00516.77
7.3.10.0060.01116.63
7.3.00.0040.00816.71
7.2.330.0090.00916.78
7.2.320.0140.00716.58
7.2.310.0070.01016.60
7.2.300.0070.01016.67
7.2.290.0170.00016.46
7.2.250.0040.01114.93
7.2.240.0110.00615.04
7.2.230.0030.01315.00
7.2.220.0030.00914.85
7.2.210.0070.01014.80
7.2.200.0030.00915.11
7.2.190.0060.00614.95
7.2.180.0100.01015.13
7.2.170.0040.00714.77
7.2.160.0020.01214.83
7.2.150.0090.00616.86
7.2.140.0060.01316.80
7.2.130.0080.00416.81
7.2.120.0030.01016.99
7.2.110.0110.00616.93
7.2.100.0060.00716.81
7.2.90.0050.01316.88
7.2.80.0070.00716.86
7.2.70.0030.01116.73
7.2.60.0040.01116.87
7.2.50.0060.01116.81
7.2.40.0040.01216.98
7.2.30.0100.00417.00
7.2.20.0080.00516.84
7.2.10.0040.00716.96
7.2.00.0060.00817.00
7.1.330.0080.01215.77
7.1.320.0070.01015.74
7.1.310.0080.00615.81
7.1.300.0000.00815.75
7.1.290.0000.01415.82
7.1.280.0000.01415.83
7.1.270.0090.00415.94
7.1.260.0070.00515.83
7.1.250.0040.00715.90
7.1.240.0040.01115.93
7.1.230.0140.00015.60
7.1.220.0030.01315.83
7.1.210.0060.00915.96
7.1.200.0040.01115.97
7.1.190.0060.00315.71
7.1.180.0070.00715.63
7.1.170.0110.00315.80
7.1.160.0060.00915.99
7.1.150.0060.00915.89
7.1.140.0040.00715.75
7.1.130.0000.00915.54
7.1.120.0030.01315.64
7.1.110.0030.01015.71
7.1.100.0050.00516.02
7.1.90.0030.01015.85
7.1.80.0070.01015.89
7.1.70.0080.00815.79
7.1.60.0000.01515.96
7.1.50.0060.00615.85
7.1.40.0090.00315.88
7.1.30.0030.00615.84
7.1.20.0000.01215.93
7.1.10.0030.01315.87
7.1.00.0030.00615.85

preferences:
27.18 ms | 403 KiB | 5 Q