3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = []; $arr = [ 'chatduration' => '124.502','username' => 'bhavin']; foreach($arr as $record){ if (array_key_exists($user[$record['username']],$record)) { $user[$record['username']] = $user[$record['username']] + $record['chatduration']; } else { $user[] = [$record['username']=>$record['chatduration']]; } } 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.3.60.0070.01118.51
8.3.50.0100.01017.92
8.3.40.0080.01218.53
8.3.30.0160.00018.67
8.3.20.0050.00221.91
8.3.10.0070.01121.77
8.3.00.0050.00319.68
8.2.180.0000.01418.41
8.2.170.0060.00922.96
8.2.160.0100.00320.52
8.2.150.0060.01125.66
8.2.140.0000.00724.66
8.2.130.0070.00020.41
8.2.120.0040.00426.35
8.2.110.0090.00019.29
8.2.100.0050.00817.80
8.2.90.0090.00017.75
8.2.80.0060.00318.73
8.2.70.0060.00317.75
8.2.60.0080.00017.75
8.2.50.0060.00318.16
8.2.40.0090.00019.78
8.2.30.0040.00421.10
8.2.20.0050.00218.19
8.2.10.0040.00418.14
8.2.00.0030.00518.03
8.1.280.0070.00725.92
8.1.270.0150.00022.25
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00322.77
8.1.230.0100.00020.89
8.1.220.0040.00418.70
8.1.210.0000.00918.77
8.1.200.0000.00817.25
8.1.190.0060.00317.35
8.1.180.0060.00318.10
8.1.170.0000.00817.62
8.1.160.0000.00718.96
8.1.150.0000.00720.27
8.1.140.0000.00717.56
8.1.130.0000.00719.02
8.1.120.0090.00017.54
8.1.110.0020.00517.46
8.1.100.0040.00417.48
8.1.90.0000.00817.46
8.1.80.0040.00417.36
8.1.70.0000.00817.39
8.1.60.0000.00817.53
8.1.50.0030.00717.52
8.1.40.0000.00717.48
8.1.30.0040.00417.58
8.1.20.0000.00817.59
8.1.10.0030.00617.59
8.1.00.0000.00917.49
8.0.300.0070.00018.77
8.0.290.0000.00916.75
8.0.280.0030.00318.46
8.0.270.0040.00417.25
8.0.260.0040.00416.82
8.0.250.0030.00317.09
8.0.240.0050.00317.01
8.0.230.0030.00316.91
8.0.220.0070.00016.88
8.0.210.0030.00316.87
8.0.200.0000.00616.94
8.0.190.0040.00417.03
8.0.180.0000.00817.00
8.0.170.0000.00817.00
8.0.160.0090.00416.87
8.0.150.0000.00716.87
8.0.140.0080.00016.98
8.0.130.0000.00613.42
8.0.120.0020.00516.83
8.0.110.0000.00816.83
8.0.100.0040.00416.77
8.0.90.0040.00416.79
8.0.80.0090.01317.01
8.0.70.0050.00316.97
8.0.60.0030.00516.92
8.0.50.0040.00416.77
8.0.30.0110.00716.98
8.0.20.0100.00917.40
8.0.10.0000.00816.93
8.0.00.0080.01116.95
7.4.330.0050.00015.55
7.4.320.0030.00316.63
7.4.300.0040.00416.62
7.4.290.0100.00016.42
7.4.280.0000.00716.49
7.4.270.0040.00416.60
7.4.260.0000.00716.50
7.4.250.0050.00216.47
7.4.240.0030.00316.61
7.4.230.0040.00416.61
7.4.220.0070.00016.70
7.4.210.0090.00516.59
7.4.200.0030.00316.62
7.4.160.0090.00916.53
7.4.150.0140.00317.40
7.4.140.0070.01017.86
7.4.130.0090.01316.61
7.4.120.0100.01016.45
7.4.110.0120.00616.68
7.4.100.0060.01516.54
7.4.90.0170.00716.68
7.4.80.0100.01019.39
7.4.70.0070.01016.60
7.4.60.0070.01016.53
7.4.50.0000.01316.30
7.4.40.0000.01616.58
7.4.00.0030.01014.62
7.3.330.0050.00013.30
7.3.320.0030.00313.23
7.3.310.0000.00716.21
7.3.300.0040.00416.40
7.3.290.0070.00016.34
7.3.280.0070.00916.35
7.3.270.0100.00717.40
7.3.260.0110.00616.41
7.3.240.0100.00816.38
7.3.230.0170.00016.29
7.3.210.0080.01216.43
7.3.200.0000.01616.29
7.3.190.0080.00816.30
7.3.180.0090.00616.28
7.3.170.0030.01316.49
7.3.160.0110.00616.68
7.2.330.0090.01216.55
7.2.320.0100.00716.79
7.2.310.0070.01016.68
7.2.300.0170.01016.61
7.2.290.0160.00616.43
7.2.60.0000.01516.80
7.2.20.0090.01519.83
7.2.10.0150.01019.99
7.2.00.0070.01120.02
7.1.200.0000.01115.82
7.1.140.0070.01418.89
7.1.130.0110.00818.54
7.1.120.0050.01218.54
7.1.110.0140.00918.05
7.1.100.0090.01418.03
7.1.90.0090.00818.14
7.1.80.0090.00718.04
7.1.70.0030.01217.18
7.1.60.0310.01634.72
7.1.50.0320.01634.63
7.1.40.0230.01234.45
7.1.30.0320.01434.64
7.1.20.0260.00934.64
7.1.10.0100.01316.64
7.1.00.0050.01616.63

preferences:
54.47 ms | 401 KiB | 5 Q