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']; echo "inside"; } 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.70.0070.01318.55
8.3.60.0180.00418.55
8.3.50.0080.00817.63
8.3.40.0100.01018.80
8.3.30.0130.00318.76
8.3.20.0040.00421.65
8.3.10.0100.00721.91
8.3.00.0100.00019.68
8.2.190.0110.00716.58
8.2.180.0060.01218.28
8.2.170.0120.00322.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00020.38
8.2.120.0040.00426.35
8.2.110.0090.00020.91
8.2.100.0080.00417.84
8.2.90.0040.00418.03
8.2.80.0000.00918.03
8.2.70.0040.00417.93
8.2.60.0060.00317.50
8.2.50.0040.00418.16
8.2.40.0040.00420.42
8.2.30.0040.00421.09
8.2.20.0040.00418.23
8.2.10.0030.00518.09
8.2.00.0040.00418.18
8.1.280.0100.00725.92
8.1.270.0040.00422.10
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00524.02
8.1.230.0040.00822.71
8.1.220.0030.00517.78
8.1.210.0080.00019.03
8.1.200.0000.00817.35
8.1.190.0060.00317.23
8.1.180.0090.00018.10
8.1.170.0000.00818.70
8.1.160.0040.00418.94
8.1.150.0040.00420.26
8.1.140.0080.00017.70
8.1.130.0030.00318.92
8.1.120.0060.00317.48
8.1.110.0000.00717.48
8.1.100.0040.00417.47
8.1.90.0000.00817.44
8.1.80.0000.00817.43
8.1.70.0040.00417.34
8.1.60.0040.00417.50
8.1.50.0000.01117.48
8.1.40.0000.00717.41
8.1.30.0040.00417.54
8.1.20.0040.00417.56
8.1.10.0000.00717.50
8.1.00.0060.00317.44
8.0.300.0040.00420.10
8.0.290.0060.00316.75
8.0.280.0070.00018.35
8.0.270.0000.00717.17
8.0.260.0000.00716.69
8.0.250.0030.00516.96
8.0.240.0040.00416.98
8.0.230.0030.00316.95
8.0.220.0030.00316.91
8.0.210.0020.00416.92
8.0.200.0040.00416.94
8.0.190.0060.00316.95
8.0.180.0000.00816.82
8.0.170.0040.00416.80
8.0.160.0040.00516.84
8.0.150.0070.00016.90
8.0.140.0080.00016.75
8.0.130.0050.00013.34
8.0.120.0040.00416.86
8.0.110.0030.00616.79
8.0.100.0070.00016.85
8.0.90.0000.00716.75
8.0.80.0070.00716.88
8.0.70.0040.00416.88
8.0.60.0040.00416.80
8.0.50.0000.00716.71
8.0.30.0100.01017.01
8.0.20.0130.00817.40
8.0.10.0050.00316.79
8.0.00.0120.00616.62
7.4.330.0000.00515.55
7.4.320.0000.00616.59
7.4.300.0040.00416.62
7.4.290.0040.00416.49
7.4.280.0000.00716.59
7.4.270.0040.00416.61
7.4.260.0000.00616.47
7.4.250.0070.00016.36
7.4.240.0040.00416.57
7.4.230.0030.00316.31
7.4.220.0000.00816.64
7.4.210.0110.00716.60
7.4.200.0070.00016.50
7.4.160.0110.00516.49
7.4.150.0030.01317.40
7.4.140.0130.00717.86
7.4.130.0070.01316.40
7.4.120.0130.00916.51
7.4.110.0110.01116.34
7.4.100.0090.01516.50
7.4.90.0150.00316.48
7.4.80.0080.01619.39
7.4.70.0040.01616.40
7.4.60.0070.01016.44
7.4.50.0030.01016.65
7.4.40.0150.00016.57
7.4.00.0030.01014.77
7.3.330.0050.00013.18
7.3.320.0030.00313.07
7.3.310.0030.00316.40
7.3.300.0030.00516.28
7.3.290.0030.00316.22
7.3.280.0070.00716.27
7.3.270.0030.01417.40
7.3.260.0080.01216.34
7.3.240.0110.00816.29
7.3.230.0090.00616.50
7.3.210.0030.01316.20
7.3.200.0000.01716.22
7.3.190.0090.00616.22
7.3.180.0030.01316.37
7.3.170.0040.01216.51
7.3.160.0060.00916.37
7.2.330.0090.00916.69
7.2.320.0060.01516.71
7.2.310.0130.01016.77
7.2.300.0140.00316.43
7.2.290.0130.00916.45
7.2.60.0070.00716.81
7.2.20.0100.01319.95
7.2.10.0120.01219.96
7.2.00.0080.01519.82
7.1.200.0040.00815.62
7.1.140.0080.01418.73
7.1.130.0090.01018.63
7.1.120.0070.01518.89
7.1.110.0070.01318.06
7.1.100.0080.00918.25
7.1.90.0130.01118.15
7.1.80.0100.01217.91
7.1.70.0090.01317.00
7.1.60.0260.01234.91
7.1.50.0260.01134.79
7.1.40.0280.02134.30
7.1.30.0260.01434.47
7.1.20.0320.01534.70
7.1.10.0040.01516.67
7.1.00.0070.00916.88

preferences:
34.45 ms | 401 KiB | 5 Q