3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = []; $arr = [ 'chatduration' => '124.502','username' => 'bhavin']; print_r($arr); die(); 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.0100.01318.43
8.3.50.0150.00317.96
8.3.40.0130.00718.62
8.3.30.0120.00418.79
8.3.20.0050.00221.70
8.3.10.0040.00421.49
8.3.00.0030.00519.66
8.2.180.0070.00718.42
8.2.170.0070.00722.96
8.2.160.0130.00320.52
8.2.150.0100.00725.66
8.2.140.0020.00524.66
8.2.130.0080.00020.43
8.2.120.0040.00426.35
8.2.110.0040.00419.27
8.2.100.0130.00017.84
8.2.90.0000.00818.98
8.2.80.0040.00417.97
8.2.70.0040.00417.80
8.2.60.0000.00917.63
8.2.50.0040.00418.10
8.2.40.0000.00720.59
8.2.30.0050.00320.95
8.2.20.0000.00717.93
8.2.10.0070.00018.14
8.2.00.0080.00018.11
8.1.280.0110.00425.92
8.1.270.0080.00822.20
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00324.02
8.1.230.0070.00317.71
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0000.00817.23
8.1.180.0070.00018.10
8.1.170.0040.00418.32
8.1.160.0040.00418.74
8.1.150.0040.00420.31
8.1.140.0040.00417.50
8.1.130.0030.00319.02
8.1.120.0030.00817.41
8.1.110.0000.00717.25
8.1.100.0040.00417.31
8.1.90.0040.00417.35
8.1.80.0070.00017.35
8.1.70.0050.00317.34
8.1.60.0050.00317.44
8.1.50.0120.00017.48
8.1.40.0000.00717.55
8.1.30.0060.00317.66
8.1.20.0050.00317.64
8.1.10.0080.00017.39
8.1.00.0080.00017.32
8.0.300.0000.00818.77
8.0.290.0060.00316.63
8.0.280.0000.00718.31
8.0.270.0040.00417.25
8.0.260.0070.00016.82
8.0.250.0030.00316.85
8.0.240.0050.00316.86
8.0.230.0000.00716.91
8.0.220.0030.00316.87
8.0.210.0070.00016.87
8.0.200.0070.00016.93
8.0.190.0040.00416.93
8.0.180.0060.00316.81
8.0.170.0000.00816.78
8.0.160.0000.00916.98
8.0.150.0030.00516.84
8.0.140.0040.00416.86
8.0.130.0060.00013.27
8.0.120.0000.00716.82
8.0.110.0040.00416.77
8.0.100.0000.00716.85
8.0.90.0000.00716.70
8.0.80.0070.00916.83
8.0.70.0000.00816.73
8.0.60.0070.00016.67
8.0.50.0040.00416.83
8.0.30.0120.00916.91
8.0.20.0100.01117.40
8.0.10.0060.00316.79
8.0.00.0090.01116.67
7.4.330.0020.00215.55
7.4.320.0060.00016.52
7.4.300.0030.00316.51
7.4.290.0030.00516.46
7.4.280.0030.00316.50
7.4.270.0030.00316.48
7.4.260.0030.00316.50
7.4.250.0070.00016.39
7.4.240.0040.00416.33
7.4.230.0030.00316.29
7.4.220.0030.00516.52
7.4.210.0040.01116.47
7.4.200.0000.00716.44
7.4.160.0100.00716.51
7.4.150.0090.00917.40
7.4.140.0090.00817.86
7.4.130.0130.00916.51
7.4.120.0130.00816.35
7.4.110.0070.01016.43
7.4.100.0110.00716.51
7.4.90.0070.01016.32
7.4.80.0100.01319.39
7.4.70.0120.00916.25
7.4.60.0060.01016.36
7.4.50.0060.00616.27
7.4.40.0060.01016.66
7.4.10.0040.01414.63
7.4.00.0080.00614.97
7.3.330.0050.00013.12
7.3.320.0000.00613.03
7.3.310.0030.00316.16
7.3.300.0070.00016.21
7.3.290.0000.00716.18
7.3.280.0070.00916.15
7.3.270.0040.01317.40
7.3.260.0140.00716.20
7.3.240.0130.00816.36
7.3.230.0100.00716.23
7.3.210.0070.01416.17
7.3.200.0060.01016.38
7.3.190.0100.00616.30
7.3.180.0040.01216.23
7.3.170.0090.01216.40
7.3.160.0030.01316.34
7.3.130.0100.00714.65
7.3.120.0060.01114.34
7.3.110.0050.01014.65
7.3.100.0030.01214.61
7.3.90.0090.00614.49
7.3.80.0030.00914.40
7.3.70.0020.01314.65
7.3.60.0050.00914.64
7.3.50.0070.00714.63
7.3.40.0070.00714.68
7.3.30.0090.00514.72
7.3.20.0020.01516.38
7.3.10.0060.01116.43
7.3.00.0100.00316.32
7.2.330.0140.01016.66
7.2.320.0130.00416.31
7.2.310.0030.01316.57
7.2.300.0140.00716.62
7.2.290.0110.01216.28
7.2.260.0110.00414.99
7.2.250.0090.00914.87
7.2.240.0040.00914.69
7.2.230.0060.00914.70
7.2.220.0080.00714.91
7.2.210.0090.00214.93
7.2.200.0060.00614.88
7.2.190.0040.01414.68
7.2.180.0050.00914.76
7.2.170.0060.00614.81
7.2.160.0070.00614.59
7.2.150.0040.01016.59
7.2.140.0080.01016.51
7.2.130.0090.00616.69
7.2.120.0080.00516.60
7.2.110.0080.00816.65
7.2.100.0060.00716.61
7.2.90.0050.00616.67
7.2.80.0060.00916.62
7.2.70.0050.01016.78
7.2.60.0050.00916.75
7.2.50.0050.00816.72
7.2.40.0060.00716.80
7.2.30.0070.01016.71
7.2.20.0040.01117.67
7.2.10.0040.01317.67
7.2.00.0080.01117.77
7.1.330.0060.00815.57
7.1.320.0040.00815.67
7.1.310.0070.00715.57
7.1.300.0070.00715.49
7.1.290.0080.00515.68
7.1.280.0080.00515.43
7.1.270.0050.01315.67
7.1.260.0110.00715.51
7.1.250.0080.00615.53
7.1.240.0090.00315.50
7.1.230.0030.00815.38
7.1.220.0060.00815.33
7.1.210.0030.00715.64
7.1.200.0080.00615.63
7.1.190.0160.00015.84
7.1.180.0070.00715.80
7.1.170.0040.01115.67
7.1.160.0100.00715.68
7.1.150.0000.01315.65
7.1.140.0080.00917.12
7.1.130.0060.01117.18
7.1.120.0070.01116.92
7.1.110.0080.01016.80
7.1.100.0110.00616.79
7.1.90.0080.00917.03
7.1.80.0040.01116.78
7.1.70.0080.00716.24
7.1.60.0160.00925.17
7.1.50.0130.00925.10
7.1.40.0120.01325.01
7.1.30.0120.01424.97
7.1.20.0210.00825.04
7.1.10.0030.01316.02
7.1.00.0050.01316.01
7.0.330.0070.00715.34
7.0.320.0030.01015.25
7.0.310.0100.00614.91
7.0.300.0000.01215.53
7.0.290.0030.01315.50
7.0.280.0040.00415.31
7.0.270.0030.01015.05
7.0.260.0000.01315.26
7.0.250.0030.01315.25
7.0.240.0070.00715.17
7.0.230.0080.00615.14
7.0.220.0100.00615.17
7.0.210.0060.00615.02
7.0.200.0040.01115.31
7.0.190.0030.00715.50
7.0.180.0100.00315.28
7.0.170.0050.00515.48
7.0.160.0060.00615.57
7.0.150.0070.00715.28
7.0.140.0030.01015.54
7.0.130.0000.00815.32
7.0.120.0060.00615.45
7.0.110.0030.01015.43
7.0.100.0060.00915.41
7.0.90.0040.01115.36
7.0.80.0030.00615.20
7.0.70.0070.00715.22
7.0.60.0100.00315.46
7.0.50.0030.00615.55
7.0.40.0030.01013.45
7.0.30.0030.01313.46
7.0.20.0070.00713.48
7.0.10.0070.00613.34
7.0.00.0040.00812.92
5.6.400.0160.00313.93
5.6.390.0070.00714.26
5.6.380.0000.01014.47
5.6.370.0030.00614.15
5.6.360.0040.01214.38
5.6.350.0140.00314.32
5.6.340.0060.00314.61
5.6.330.0090.00614.36
5.6.320.0040.01114.50
5.6.310.0030.01014.11
5.6.300.0070.01014.04
5.6.290.0000.01514.18
5.6.280.0000.01114.28
5.6.270.0040.00714.20
5.6.260.0030.01014.15
5.6.250.0040.00414.36
5.6.240.0090.00614.15
5.6.230.0100.00614.36
5.6.220.0120.00314.28
5.6.210.0040.01114.21
5.6.200.0060.00314.28
5.6.190.0000.00914.04
5.6.180.0000.01314.21
5.6.170.0030.01014.19
5.6.160.0060.00614.20
5.6.150.0080.00814.41
5.6.140.0080.00814.24
5.6.130.0080.00414.23
5.6.120.0070.01014.27
5.6.110.0140.00314.11
5.6.100.0100.00713.87
5.6.90.0030.00614.18
5.6.80.0050.00513.91
5.6.70.0050.00514.22
5.6.60.0050.00514.17
5.6.50.0000.00914.18
5.6.40.0070.00314.24
5.6.30.0100.00314.21
5.6.20.0080.00414.23
5.6.10.0000.01014.21
5.6.00.0100.00313.89

preferences:
57.57 ms | 400 KiB | 5 Q