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($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.01018.42
8.3.50.0140.00716.38
8.3.40.0120.00618.65
8.3.30.0130.00318.71
8.3.20.0050.00323.67
8.3.10.0000.00821.77
8.3.00.0090.00019.80
8.2.180.0120.00316.73
8.2.170.0070.01422.96
8.2.160.0130.00020.52
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00420.52
8.2.120.0040.00426.35
8.2.110.0070.00319.34
8.2.100.0040.00818.03
8.2.90.0050.00317.90
8.2.80.0030.00618.22
8.2.70.0040.00418.03
8.2.60.0070.00317.63
8.2.50.0000.00718.28
8.2.40.0000.00820.55
8.2.30.0000.00820.97
8.2.20.0030.00518.12
8.2.10.0040.00418.04
8.2.00.0060.00318.17
8.1.280.0120.00625.92
8.1.270.0070.00722.14
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00322.62
8.1.230.0110.00022.65
8.1.220.0000.00817.74
8.1.210.0030.00618.97
8.1.200.0000.00917.48
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0000.00818.47
8.1.160.0040.00418.80
8.1.150.0030.00620.17
8.1.140.0040.00417.70
8.1.130.0030.00319.06
8.1.120.0090.00017.35
8.1.110.0040.00417.48
8.1.100.0050.00217.36
8.1.90.0000.00817.53
8.1.80.0030.00517.49
8.1.70.0070.00017.49
8.1.60.0080.00017.53
8.1.50.0080.00317.47
8.1.40.0000.00717.51
8.1.30.0050.00317.54
8.1.20.0030.00517.66
8.1.10.0000.00717.42
8.1.00.0060.00317.32
8.0.300.0000.00720.15
8.0.290.0050.00316.75
8.0.280.0030.00518.48
8.0.270.0030.00417.17
8.0.260.0050.00216.73
8.0.250.0040.00316.98
8.0.240.0050.00316.93
8.0.230.0000.00716.78
8.0.220.0030.00316.90
8.0.210.0030.00516.93
8.0.200.0030.00616.93
8.0.190.0080.00016.81
8.0.180.0060.00316.80
8.0.170.0060.00316.80
8.0.160.0000.01116.87
8.0.150.0000.00816.72
8.0.140.0030.00416.71
8.0.130.0030.00313.36
8.0.120.0000.00716.75
8.0.110.0000.00816.72
8.0.100.0000.00716.92
8.0.90.0050.00216.70
8.0.80.0080.00816.92
8.0.70.0080.00017.00
8.0.60.0040.00416.79
8.0.50.0030.00516.70
8.0.30.0100.00917.12
8.0.20.0090.01117.40
8.0.10.0080.00016.99
8.0.00.0050.01316.74
7.4.330.0030.00315.55
7.4.320.0030.00316.65
7.4.300.0000.00616.59
7.4.290.0050.00216.59
7.4.280.0040.00416.41
7.4.270.0000.00716.45
7.4.260.0030.00316.63
7.4.250.0030.00316.55
7.4.240.0030.00316.43
7.4.230.0040.00416.68
7.4.220.0070.00016.40
7.4.210.0110.00516.51
7.4.200.0030.00316.54
7.4.160.0110.00516.47
7.4.150.0150.00417.40
7.4.140.0100.00617.86
7.4.130.0120.00616.55
7.4.120.0070.01116.52
7.4.110.0150.00616.64
7.4.100.0120.00916.43
7.4.90.0090.00916.54
7.4.80.0140.00519.39
7.4.70.0120.00616.45
7.4.60.0080.00816.54
7.4.50.0000.01416.29
7.4.40.0130.00316.47
7.4.00.0030.01215.11
7.3.330.0060.00013.07
7.3.320.0000.00513.05
7.3.310.0000.00716.39
7.3.300.0000.00716.36
7.3.290.0030.00316.23
7.3.280.0090.00716.29
7.3.270.0120.00617.40
7.3.260.0090.00816.38
7.3.240.0120.00816.34
7.3.230.0050.01116.57
7.3.210.0100.00616.46
7.3.200.0050.01016.37
7.3.190.0070.01016.36
7.3.180.0160.00016.29
7.3.170.0030.01416.62
7.3.160.0090.00616.36
7.2.330.0130.00316.71
7.2.320.0140.00716.68
7.2.310.0100.00716.63
7.2.300.0150.00616.69
7.2.290.0070.01516.70
7.2.60.0030.01316.89
7.2.20.0090.01120.02
7.2.10.0120.01119.98
7.2.00.0130.00820.00
7.1.200.0030.00515.55
7.1.140.0090.01318.54
7.1.130.0110.00518.95
7.1.120.0080.00818.78
7.1.110.0060.01017.82
7.1.100.0080.01317.77
7.1.90.0110.00918.23
7.1.80.0090.00917.91
7.1.70.0050.01017.00
7.1.60.0270.00935.13
7.1.50.0230.01034.65
7.1.40.0260.00834.20
7.1.30.0240.01034.43
7.1.20.0310.01734.60
7.1.10.0120.01016.54
7.1.00.0080.01416.43

preferences:
56.11 ms | 401 KiB | 5 Q