3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = []; $arr = [[ 'chatduration' => 124.502,'username' => 'bhavin'],[ 'chatduration' => 124.502,'username' => 'bhavin']]; foreach($arr as $record){ if (array_key_exists($record['username'],$record)) { $user[$record['username']] = $user[$record['username']] + $record['chatduration']; } else { $user[$record['username']] = $record['chatduration']; } } print_r($user);

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.0180.00318.43
8.3.50.0110.01116.61
8.3.40.0110.00818.44
8.3.30.0110.00418.58
8.3.20.0040.00421.77
8.3.10.0080.00021.85
8.3.00.0050.00319.56
8.2.180.0040.01518.48
8.2.170.0070.00722.96
8.2.160.0100.00320.47
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0050.00320.35
8.2.120.0040.00426.35
8.2.110.0090.00021.19
8.2.100.0060.00617.84
8.2.90.0040.00417.84
8.2.80.0090.00018.03
8.2.70.0060.00318.05
8.2.60.0050.00519.48
8.2.50.0070.00018.28
8.2.40.0000.00720.39
8.2.30.0060.00321.09
8.2.20.0040.00418.07
8.2.10.0080.00018.01
8.2.00.0000.00718.04
8.1.280.0120.00625.92
8.1.270.0050.00322.23
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0070.00322.79
8.1.220.0000.00917.74
8.1.210.0040.00418.88
8.1.200.0090.00017.35
8.1.190.0060.00317.10
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0070.00019.00
8.1.150.0040.00422.11
8.1.140.0040.00417.74
8.1.130.0000.00719.02
8.1.120.0090.00017.44
8.1.110.0000.00817.33
8.1.100.0000.00817.39
8.1.90.0050.00317.49
8.1.80.0000.00717.34
8.1.70.0040.00417.49
8.1.60.0030.00517.55
8.1.50.0100.00017.55
8.1.40.0050.00217.55
8.1.30.0000.00817.56
8.1.20.0050.00317.70
8.1.10.0040.00417.51
8.1.00.0040.00417.46
8.0.300.0050.00320.09
8.0.290.0030.00616.75
8.0.280.0000.00818.45
8.0.270.0060.00317.21
8.0.260.0040.00416.75
8.0.250.0070.00016.84
8.0.240.0000.00816.95
8.0.230.0030.00316.96
8.0.220.0060.00016.87
8.0.210.0040.00416.82
8.0.200.0040.00416.95
8.0.190.0040.00416.98
8.0.180.0030.00616.80
8.0.170.0080.00016.84
8.0.160.0120.00016.91
8.0.150.0030.00616.69
8.0.140.0040.00416.75
8.0.130.0000.00713.32
8.0.120.0000.00716.80
8.0.110.0030.00616.86
8.0.100.0000.00716.74
8.0.90.0070.00016.69
8.0.80.0140.00816.89
8.0.70.0080.00016.98
8.0.60.0040.00416.92
8.0.50.0050.00216.78
8.0.30.0110.00717.06
8.0.20.0100.00817.40
8.0.10.0030.00317.05
8.0.00.0090.01016.77
7.4.330.0000.00515.55
7.4.320.0030.00316.60
7.4.300.0060.00016.51
7.4.290.0000.00716.55
7.4.280.0030.00516.59
7.4.270.0000.00716.59
7.4.260.0000.00716.50
7.4.250.0040.00416.57
7.4.240.0040.00216.61
7.4.230.0030.00316.70
7.4.220.0000.00716.49
7.4.210.0090.00916.61
7.4.200.0000.00716.65
7.4.160.0090.00916.52
7.4.150.0190.00017.40
7.4.140.0100.00917.86
7.4.130.0030.01416.59
7.4.120.0090.01116.45
7.4.110.0070.01416.63
7.4.100.0090.00916.55
7.4.90.0100.00716.56
7.4.80.0120.01219.39
7.4.70.0090.00916.67
7.4.60.0060.00916.50
7.4.50.0090.00616.25
7.4.40.0060.00916.59
7.4.00.0070.01014.71
7.3.330.0030.00313.20
7.3.320.0000.00713.26
7.3.310.0070.00016.46
7.3.300.0020.00516.29
7.3.290.0000.00716.36
7.3.280.0090.00716.37
7.3.270.0070.01117.40
7.3.260.0110.00716.33
7.3.240.0100.00716.41
7.3.230.0110.00616.41
7.3.210.0060.01016.34
7.3.200.0080.00816.42
7.3.190.0060.00916.38
7.3.180.0090.00616.61
7.3.170.0120.00416.27
7.3.160.0070.01016.44
7.3.10.0100.00016.71
7.3.00.0030.00716.56
7.2.330.0100.00716.63
7.2.320.0080.00816.48
7.2.310.0080.00816.54
7.2.300.0170.00016.41
7.2.290.0160.00616.68
7.2.130.0070.00716.61
7.2.120.0120.00316.95
7.2.110.0090.00616.78
7.2.100.0080.00617.05
7.2.90.0040.01117.02
7.2.80.0090.00316.93
7.2.70.0000.01017.07
7.2.60.0060.00816.87
7.2.50.0030.00617.00
7.2.40.0070.00317.01
7.2.30.0110.00316.99
7.2.20.0080.01118.38
7.2.10.0040.01518.29
7.2.00.0080.01118.28
7.1.250.0070.00015.64
7.1.200.0000.01115.83
7.1.140.0090.01419.00
7.1.130.0070.01118.59
7.1.120.0120.01418.79
7.1.110.0070.01218.18
7.1.100.0040.01217.73
7.1.90.0020.01418.18
7.1.80.0100.01117.96
7.1.70.0080.00716.82
7.1.60.0290.01634.96
7.1.50.0250.01334.84
7.1.40.0330.01634.45
7.1.30.0260.01734.63
7.1.20.0310.01834.55
7.1.10.0070.01816.70
7.1.00.0060.01216.58

preferences:
58.8 ms | 401 KiB | 5 Q