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.0190.00418.55
8.3.50.0150.00616.29
8.3.40.0150.00718.54
8.3.30.0110.00418.79
8.3.20.0080.00021.81
8.3.10.0040.00421.95
8.3.00.0150.00019.56
8.2.180.0160.00616.76
8.2.170.0090.00622.96
8.2.160.0070.00720.21
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00420.27
8.2.120.0070.00726.35
8.2.110.0050.00522.29
8.2.100.0060.00617.91
8.2.90.0080.00017.87
8.2.80.0040.00419.40
8.2.70.0000.00818.03
8.2.60.0050.00519.48
8.2.50.0000.00718.22
8.2.40.0000.00720.55
8.2.30.0000.00721.02
8.2.20.0000.00718.15
8.2.10.0040.00418.05
8.2.00.0000.00718.14
8.1.280.0100.00625.92
8.1.270.0090.00622.14
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0080.00322.47
8.1.230.0070.00320.95
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0030.00517.35
8.1.180.0000.00818.10
8.1.170.0030.00618.50
8.1.160.0000.00818.95
8.1.150.0050.00220.14
8.1.140.0080.00017.75
8.1.130.0000.00719.03
8.1.120.0030.00617.36
8.1.110.0070.00017.39
8.1.100.0040.00417.49
8.1.90.0040.00417.36
8.1.80.0080.00017.45
8.1.70.0000.00717.49
8.1.60.0000.00817.59
8.1.50.0110.00017.54
8.1.40.0000.00817.55
8.1.30.0030.00617.55
8.1.20.0000.00717.59
8.1.10.0070.00017.49
8.1.00.0060.00317.40
8.0.300.0090.00021.74
8.0.290.0040.00416.75
8.0.280.0040.00418.41
8.0.270.0030.00517.16
8.0.260.0000.00716.88
8.0.250.0030.00317.03
8.0.240.0040.00416.96
8.0.230.0040.00416.91
8.0.220.0000.00717.01
8.0.210.0030.00316.96
8.0.200.0000.00716.90
8.0.190.0000.00716.89
8.0.180.0030.00516.96
8.0.170.0000.00917.00
8.0.160.0050.00516.98
8.0.150.0000.00716.84
8.0.140.0020.00516.77
8.0.130.0030.00313.39
8.0.120.0070.00017.00
8.0.110.0050.00316.86
8.0.100.0040.00416.89
8.0.90.0000.00716.90
8.0.80.0080.00816.91
8.0.70.0000.00817.07
8.0.60.0000.00816.81
8.0.50.0000.00716.95
8.0.30.0120.00617.13
8.0.20.0110.00917.40
8.0.10.0070.00016.91
8.0.00.0040.01417.01
7.4.330.0050.00015.55
7.4.320.0030.00316.65
7.4.300.0070.00016.59
7.4.290.0040.00416.53
7.4.280.0040.00416.50
7.4.270.0000.00716.65
7.4.260.0030.00316.58
7.4.250.0030.00316.48
7.4.240.0030.00616.52
7.4.230.0030.00316.44
7.4.220.0020.00516.53
7.4.210.0060.00916.59
7.4.200.0030.00316.50
7.4.160.0080.00816.56
7.4.150.0110.00617.40
7.4.140.0100.01017.86
7.4.130.0140.00416.42
7.4.120.0070.01116.54
7.4.110.0140.00416.64
7.4.100.0110.00816.63
7.4.90.0130.00916.65
7.4.80.0100.01319.39
7.4.70.0100.01016.55
7.4.60.0070.01016.49
7.4.50.0110.00416.34
7.4.40.0170.00316.67
7.4.10.0090.00914.91
7.4.00.0070.00714.96
7.3.330.0000.00513.22
7.3.320.0000.00613.31
7.3.310.0000.00716.29
7.3.300.0030.00316.42
7.3.290.0070.00016.23
7.3.280.0080.00816.36
7.3.270.0130.00617.40
7.3.260.0150.00416.45
7.3.240.0050.01216.42
7.3.230.0100.00616.56
7.3.210.0040.01316.31
7.3.200.0000.01616.39
7.3.190.0100.00716.43
7.3.180.0170.00016.36
7.3.170.0060.01316.49
7.3.160.0070.01316.56
7.3.130.0030.01414.87
7.3.120.0060.01215.09
7.3.110.0060.01214.95
7.3.100.0070.01114.78
7.3.90.0060.00614.85
7.3.80.0000.01514.78
7.3.70.0000.01414.88
7.3.60.0090.00014.90
7.3.50.0060.00314.66
7.3.40.0040.00714.79
7.3.30.0140.00314.84
7.3.20.0080.00416.56
7.3.10.0090.00516.82
7.3.00.0110.00516.44
7.2.330.0140.00616.55
7.2.320.0030.01516.49
7.2.310.0090.00916.54
7.2.300.0100.00716.73
7.2.290.0090.00616.57
7.2.260.0090.00615.21
7.2.250.0000.01514.75
7.2.240.0040.00814.90
7.2.230.0120.00314.98
7.2.220.0030.00915.22
7.2.210.0090.00614.78
7.2.200.0060.00915.14
7.2.190.0070.00715.12
7.2.180.0100.00614.88
7.2.170.0070.01015.14
7.2.160.0030.00614.75
7.2.150.0030.01016.64
7.2.140.0070.01016.79
7.2.130.0040.01216.99
7.2.120.0060.00816.93
7.2.110.0070.00816.77
7.2.100.0050.00516.91
7.2.90.0050.01116.98
7.2.80.0090.00617.04
7.2.70.0040.00916.78
7.2.60.0070.00616.92
7.2.50.0090.00716.72
7.2.40.0030.01016.91
7.2.30.0080.00316.89
7.2.20.0090.00618.01
7.2.10.0060.01217.89
7.2.00.0040.01217.90
7.1.330.0050.00515.97
7.1.320.0090.00315.74
7.1.310.0060.01015.73
7.1.300.0040.01115.93
7.1.290.0110.00415.53
7.1.280.0000.01015.79
7.1.270.0040.00815.52
7.1.260.0100.00615.88
7.1.250.0060.00615.83
7.1.240.0030.01415.87
7.1.230.0100.00615.58
7.1.220.0120.00015.63
7.1.210.0120.00315.95
7.1.200.0070.00815.69
7.1.190.0040.00716.01
7.1.180.0040.00815.90
7.1.170.0040.01115.82
7.1.160.0040.01215.93
7.1.150.0060.00815.82
7.1.140.0090.00817.45
7.1.130.0050.01117.26
7.1.120.0040.01217.35
7.1.110.0090.01017.00
7.1.100.0080.00717.01
7.1.90.0070.00916.80
7.1.80.0040.01516.91
7.1.70.0070.00916.52
7.1.60.0160.00925.31
7.1.50.0130.01825.36
7.1.40.0160.01425.25
7.1.30.0180.01325.22
7.1.20.0160.01625.10
7.1.10.0060.00816.15
7.1.00.0050.01016.16
7.0.330.0030.01015.54
7.0.320.0000.01315.58
7.0.310.0040.00815.41
7.0.300.0070.00715.46
7.0.290.0070.00415.61
7.0.280.0100.00315.45
7.0.270.0030.00615.32
7.0.260.0030.00915.39
7.0.250.0000.01115.39
7.0.240.0100.00615.21
7.0.230.0030.00915.51
7.0.220.0070.01015.27
7.0.210.0070.01015.21
7.0.200.0100.00315.43
7.0.190.0080.00715.38
7.0.180.0030.01315.63
7.0.170.0000.01215.57
7.0.160.0070.00715.46
7.0.150.0030.00715.25
7.0.140.0060.00615.44
7.0.130.0060.00915.43
7.0.120.0030.01315.37
7.0.110.0070.00715.51
7.0.100.0070.00715.28
7.0.90.0030.00615.35
7.0.80.0000.01115.25
7.0.70.0000.01015.25
7.0.60.0080.00315.41
7.0.50.0000.01215.52
7.0.40.0100.00313.36
7.0.30.0070.00313.58
7.0.20.0000.01113.37
7.0.10.0110.00413.40
7.0.00.0040.00813.37
5.6.400.0090.00914.13
5.6.390.0090.00913.98
5.6.380.0080.00314.29
5.6.370.0000.01714.67
5.6.360.0030.00914.62
5.6.350.0090.00014.69
5.6.340.0070.00714.13
5.6.330.0100.00714.41
5.6.320.0090.00614.66
5.6.310.0090.00614.40
5.6.300.0000.01214.38
5.6.290.0090.00613.98
5.6.280.0030.01014.68
5.6.270.0060.00614.25
5.6.260.0040.00714.43
5.6.250.0030.01014.15
5.6.240.0000.01314.34
5.6.230.0070.01014.37
5.6.220.0100.00314.40
5.6.210.0070.00314.35
5.6.200.0040.01114.20
5.6.190.0000.01114.45
5.6.180.0060.00614.45
5.6.170.0140.00014.36
5.6.160.0050.00313.96
5.6.150.0030.01214.32
5.6.140.0090.00614.29
5.6.130.0030.01214.18
5.6.120.0040.01114.28
5.6.110.0000.01214.18
5.6.100.0040.00714.17
5.6.90.0100.00314.41
5.6.80.0090.00914.64
5.6.70.0000.01114.18
5.6.60.0080.00414.39
5.6.50.0030.01214.59
5.6.40.0070.00714.13
5.6.30.0030.01314.23
5.6.20.0110.00314.17
5.6.10.0030.00614.11
5.6.00.0120.00414.16

preferences:
122.63 ms | 400 KiB | 5 Q