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'],$user)) { $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.5.10.0070.01116.48
8.5.00.0140.00919.94
8.4.150.0030.00014.05
8.4.140.0120.01017.64
8.4.130.0130.00818.53
8.4.120.0130.00723.95
8.4.110.0080.00319.07
8.4.100.0140.00618.71
8.4.90.0110.00922.12
8.4.80.0050.00518.63
8.4.70.0090.01317.88
8.4.60.0080.01119.16
8.4.50.0140.00522.48
8.4.40.0030.01019.38
8.4.30.0000.01517.68
8.4.20.0060.00319.80
8.4.10.0040.00417.91
8.3.280.0140.00718.42
8.3.270.0110.00716.58
8.3.260.0120.00816.61
8.3.250.0120.00917.26
8.3.240.0130.00617.03
8.3.230.0100.00616.69
8.3.220.0100.01019.03
8.3.210.0120.00716.77
8.3.200.0070.00216.78
8.3.190.0090.00816.91
8.3.180.0110.00816.86
8.3.170.0090.01217.05
8.3.160.0100.00720.22
8.3.150.0180.00016.37
8.3.140.0070.01017.06
8.3.130.0040.01118.36
8.3.120.0110.00420.60
8.3.110.0090.00020.94
8.3.100.0120.00316.60
8.3.90.0130.00618.51
8.3.80.0060.00318.43
8.3.70.0110.00718.43
8.3.60.0120.00918.55
8.3.50.0080.00917.42
8.3.40.0100.01018.69
8.3.30.0070.00718.66
8.3.20.0040.00421.85
8.3.10.0000.00821.91
8.3.00.0040.00719.92
8.2.290.0110.00820.13
8.2.280.0110.00718.28
8.2.270.0100.01017.00
8.2.260.0060.00316.43
8.2.250.0090.00916.54
8.2.240.0110.00418.82
8.2.230.0090.00622.58
8.2.220.0130.00624.06
8.2.210.0040.00426.77
8.2.200.0090.00016.63
8.2.190.0070.01018.20
8.2.180.0090.01218.39
8.2.170.0110.00422.96
8.2.160.0030.01021.24
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.95
8.2.110.0030.00621.04
8.2.100.0070.00417.91
8.2.90.0000.00817.69
8.2.80.0030.00618.22
8.2.70.0040.00418.05
8.2.60.0090.00017.75
8.2.50.0050.00318.22
8.2.40.0000.00720.64
8.2.30.0050.00321.02
8.2.20.0050.00318.09
8.2.10.0080.00018.23
8.2.00.0060.00318.11
8.1.330.0130.00521.95
8.1.320.0100.00916.31
8.1.310.0040.00418.59
8.1.300.0080.00817.85
8.1.290.0030.00618.88
8.1.280.0070.01125.92
8.1.270.0080.00022.01
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.97
8.1.230.0080.00420.64
8.1.220.0040.00417.78
8.1.210.0090.00019.05
8.1.200.0050.00317.35
8.1.190.0030.00517.34
8.1.180.0060.00318.10
8.1.170.0000.00918.67
8.1.160.0030.00518.89
8.1.150.0000.00720.18
8.1.140.0000.00717.73
8.1.130.0030.00318.93
8.1.120.0040.00617.45
8.1.110.0000.00817.43
8.1.100.0040.00417.51
8.1.90.0070.00017.46
8.1.80.0000.00717.51
8.1.70.0030.00317.43
8.1.60.0040.00417.56
8.1.50.0110.00017.56
8.1.40.0000.00817.59
8.1.30.0000.00717.67
8.1.20.0070.00017.60
8.1.10.0030.00517.60
8.1.00.0050.00317.56
8.0.300.0070.00019.90
8.0.290.0040.00416.75
8.0.280.0000.00818.32
8.0.270.0000.00717.25
8.0.260.0040.00416.71
8.0.250.0040.00416.97
8.0.240.0040.00416.85
8.0.230.0030.00316.85
8.0.220.0070.00016.92
8.0.210.0000.00716.89
8.0.200.0000.00816.80
8.0.190.0070.00016.86
8.0.180.0080.00016.90
8.0.170.0060.00316.80
8.0.160.0090.00316.80
8.0.150.0040.00416.85
8.0.140.0030.00516.90
8.0.130.0000.00613.28
8.0.120.0000.00716.87
8.0.110.0040.00516.84
8.0.100.0070.00016.95
8.0.90.0000.00716.77
8.0.80.0110.00716.92
8.0.70.0050.00216.88
8.0.60.0080.00016.74
8.0.50.0000.00816.85
8.0.30.0050.01217.11
8.0.20.0170.01017.40
8.0.10.0080.00017.01
8.0.00.0080.01016.48
7.4.330.0040.00015.55
7.4.320.0000.00616.60
7.4.300.0030.00316.59
7.4.290.0030.00716.36
7.4.280.0040.00416.50
7.4.270.0020.00516.58
7.4.260.0030.00316.46
7.4.250.0000.00716.39
7.4.240.0040.00416.51
7.4.230.0000.00716.43
7.4.220.0000.00816.66
7.4.210.0080.00716.52
7.4.200.0070.00016.45
7.4.160.0090.00616.49
7.4.150.0060.01217.40
7.4.140.0110.00717.86
7.4.130.0060.01216.65
7.4.120.0090.00916.48
7.4.110.0110.01116.57
7.4.100.0060.01416.52
7.4.90.0100.01316.50
7.4.80.0140.01419.39
7.4.70.0100.01316.47
7.4.60.0060.01216.35
7.4.50.0030.01216.27
7.4.40.0100.00616.59
7.4.00.0080.00814.69
7.3.330.0060.00013.20
7.3.320.0000.00613.21
7.3.310.0030.00316.29
7.3.300.0000.00716.34
7.3.290.0070.00016.32
7.3.280.0050.01016.31
7.3.270.0150.01117.40
7.3.260.0120.00716.43
7.3.240.0110.00916.41
7.3.230.0140.00316.37
7.3.210.0100.00716.51
7.3.200.0090.00816.41
7.3.190.0030.01316.38
7.3.180.0030.01316.43
7.3.170.0100.00616.31
7.3.160.0030.01316.55
7.3.10.0040.00716.84
7.3.00.0030.00616.48
7.2.330.0060.01116.75
7.2.320.0100.00716.54
7.2.310.0070.01116.71
7.2.300.0100.00716.46
7.2.290.0070.01516.86
7.2.130.0070.00717.17
7.2.120.0030.00917.01
7.2.110.0030.00616.82
7.2.100.0060.00317.08
7.2.90.0060.00916.98
7.2.80.0030.00916.73
7.2.70.0030.00916.66
7.2.60.0060.00816.88
7.2.50.0030.01316.95
7.2.40.0070.00716.99
7.2.30.0140.00016.97
7.2.20.0090.00718.54
7.2.10.0080.00818.45
7.2.00.0060.01118.54
7.1.250.0050.00515.82
7.1.200.0070.00315.70
7.1.140.0050.01518.96
7.1.130.0080.01018.80
7.1.120.0080.01518.80
7.1.110.0070.01317.99
7.1.100.0060.01417.98
7.1.90.0050.01217.99
7.1.80.0080.00818.17
7.1.70.0060.01016.83
7.1.60.0310.01834.96
7.1.50.0310.00934.80
7.1.40.0370.01634.45
7.1.30.0320.01634.64
7.1.20.0310.01434.48
7.1.10.0050.01016.76
7.1.00.0080.00716.59

preferences:
36.56 ms | 403 KiB | 5 Q