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.0130.00918.58
8.3.50.0180.00016.50
8.3.40.0060.01319.02
8.3.30.0070.00718.81
8.3.20.0070.00021.93
8.3.10.0030.00521.89
8.3.00.0100.00319.66
8.2.180.0110.00716.61
8.2.170.0190.00322.96
8.2.160.0060.01020.09
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00420.57
8.2.120.0080.00026.35
8.2.110.0040.00421.13
8.2.100.0040.00817.91
8.2.90.0000.00818.03
8.2.80.0000.00819.22
8.2.70.0000.00818.05
8.2.60.0090.00019.35
8.2.50.0040.00418.22
8.2.40.0000.00720.55
8.2.30.0000.00821.15
8.2.20.0050.00318.14
8.2.10.0000.00718.18
8.2.00.0040.00418.18
8.1.280.0150.00325.92
8.1.270.0060.00922.14
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0110.00022.64
8.1.230.0070.00321.10
8.1.220.0050.00317.78
8.1.210.0040.00418.77
8.1.200.0030.00517.35
8.1.190.0080.00017.25
8.1.180.0020.00518.10
8.1.170.0030.00518.57
8.1.160.0020.00518.84
8.1.150.0040.00420.24
8.1.140.0050.00217.63
8.1.130.0030.00318.90
8.1.120.0000.01017.38
8.1.110.0040.00417.36
8.1.100.0080.00017.48
8.1.90.0040.00417.36
8.1.80.0040.00417.45
8.1.70.0040.00417.39
8.1.60.0050.00317.65
8.1.50.0080.00317.41
8.1.40.0000.00817.38
8.1.30.0050.00317.63
8.1.20.0000.00817.65
8.1.10.0000.00717.51
8.1.00.0030.00617.48
8.0.300.0060.00321.99
8.0.290.0080.00016.63
8.0.280.0030.00518.37
8.0.270.0050.00217.14
8.0.260.0000.00816.78
8.0.250.0070.00017.07
8.0.240.0050.00316.92
8.0.230.0070.00016.97
8.0.220.0000.00716.85
8.0.210.0030.00316.86
8.0.200.0000.00817.00
8.0.190.0030.00316.95
8.0.180.0040.00416.89
8.0.170.0000.00816.87
8.0.160.0000.00916.98
8.0.150.0070.00016.89
8.0.140.0040.00416.91
8.0.130.0050.00013.34
8.0.120.0000.00716.92
8.0.110.0050.00316.88
8.0.100.0040.00416.84
8.0.90.0020.00516.99
8.0.80.0100.00516.89
8.0.70.0000.00816.79
8.0.60.0050.00316.98
8.0.50.0070.00016.87
8.0.30.0120.00617.07
8.0.20.0110.00817.42
8.0.10.0060.00316.92
8.0.00.0110.00716.80
7.4.330.0000.00515.55
7.4.320.0000.00616.62
7.4.300.0000.00716.52
7.4.290.0080.00016.50
7.4.280.0050.00316.64
7.4.270.0040.00416.40
7.4.260.0000.00716.49
7.4.250.0030.00316.42
7.4.240.0040.00416.50
7.4.230.0000.00716.52
7.4.220.0000.00716.60
7.4.210.0090.00716.47
7.4.200.0030.00316.70
7.4.160.0070.01016.50
7.4.150.0070.01317.40
7.4.140.0130.00717.86
7.4.130.0070.01116.41
7.4.120.0110.00816.51
7.4.110.0060.01216.53
7.4.100.0180.00616.62
7.4.90.0160.00716.46
7.4.80.0030.01719.39
7.4.70.0110.01116.54
7.4.60.0090.00616.57
7.4.50.0040.01016.59
7.4.40.0080.00816.36
7.4.00.0060.00614.86
7.3.330.0030.00313.29
7.3.320.0000.00613.05
7.3.310.0030.00316.32
7.3.300.0040.00416.43
7.3.290.0030.00316.27
7.3.280.0040.01116.29
7.3.270.0070.01517.40
7.3.260.0100.01116.45
7.3.240.0060.01116.53
7.3.230.0100.00716.60
7.3.210.0100.00716.33
7.3.200.0090.00916.35
7.3.190.0130.00316.48
7.3.180.0140.00316.35
7.3.170.0100.00716.54
7.3.160.0070.01416.46
7.2.330.0120.00916.79
7.2.320.0110.01116.62
7.2.310.0100.00716.72
7.2.300.0180.00016.79
7.2.290.0080.00816.75
7.2.60.0090.00616.68
7.2.20.0090.01419.96
7.2.10.0070.01619.76
7.2.00.0070.01719.84
7.1.200.0090.00015.92
7.1.140.0100.01218.82
7.1.130.0070.01018.60
7.1.120.0090.01218.64
7.1.110.0060.01818.11
7.1.100.0100.01118.00
7.1.90.0080.01418.16
7.1.80.0060.01017.91
7.1.70.0100.00517.17
7.1.60.0240.01235.16
7.1.50.0320.01734.69
7.1.40.0260.01834.45
7.1.30.0250.01934.51
7.1.20.0300.01734.70
7.1.10.0060.01116.37
7.1.00.0070.01316.54

preferences:
68.03 ms | 401 KiB | 5 Q