3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=[ ['currency'=>'bitcoin','Totalcs'=>'1'], ['currency'=>'ethereum','Totalcs'=>'1'], ['currency'=>'ethereum','Totalcs'=>'1'] ]; foreach($array as $row){ // iterate all rows if(!isset($result[$row['currency']])){ // if first occurrence of currency... $result[$row['currency']]=$row; // save the full row with currency as the temporary key }else{ // if not the first occurrence of currency... $result[$row['currency']]['Totalcs']+=$row['Totalcs']; // add Totalcs value } } var_export(array_values($result));

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.4.140.0100.01217.57
8.4.130.0040.00517.67
8.4.120.0120.00822.25
8.4.110.0110.01018.96
8.4.100.0100.01117.71
8.4.90.0110.01017.67
8.4.80.0120.00817.89
8.4.70.0060.00317.75
8.4.60.0120.00918.84
8.4.50.0090.01120.48
8.4.40.0190.00017.38
8.4.30.0140.00719.62
8.4.20.0100.01022.31
8.4.10.0100.01017.76
8.3.270.0130.00716.84
8.3.260.0060.00516.76
8.3.250.0120.00818.61
8.3.240.0090.01016.64
8.3.230.0120.00616.77
8.3.220.0080.01016.58
8.3.210.0120.00518.65
8.3.200.0030.00616.53
8.3.190.0150.00617.35
8.3.180.0100.00816.80
8.3.170.0150.00317.10
8.3.160.0170.00016.61
8.3.150.0090.00920.71
8.3.140.0040.00417.29
8.3.130.0050.00318.59
8.3.120.0050.00318.86
8.3.110.0040.00918.16
8.3.100.0070.00318.40
8.3.90.0000.00826.77
8.3.80.0060.00319.36
8.3.70.0140.00416.63
8.3.60.0090.00618.43
8.3.50.0090.00718.27
8.3.40.0030.01218.68
8.3.30.0040.01218.89
8.3.20.0040.00420.15
8.3.10.0030.00623.83
8.3.00.0050.00319.68
8.2.290.0100.00818.96
8.2.280.0120.00618.02
8.2.270.0100.00716.95
8.2.260.0120.00616.44
8.2.250.0150.00616.48
8.2.240.0110.00720.76
8.2.230.0080.00020.94
8.2.220.0060.00324.06
8.2.210.0050.00326.77
8.2.200.0060.00618.88
8.2.190.0160.00616.88
8.2.180.0090.00616.33
8.2.170.0100.00322.96
8.2.160.0030.01020.57
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0140.00419.21
8.2.120.0050.00226.35
8.2.110.0030.00720.53
8.2.100.0090.00317.66
8.2.90.0040.00418.03
8.2.80.0060.00619.04
8.2.70.0060.00317.93
8.2.60.0080.00017.93
8.2.50.0050.00218.16
8.2.40.0030.00620.43
8.2.30.0000.00819.27
8.2.20.0000.00718.09
8.2.10.0040.00418.18
8.2.00.0070.00018.29
8.1.330.0060.00716.16
8.1.320.0130.00616.07
8.1.310.0110.00418.33
8.1.300.0130.00616.66
8.1.290.0000.00930.84
8.1.280.0040.01225.92
8.1.270.0090.00024.04
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00719.16
8.1.230.0080.00320.90
8.1.220.0000.01017.77
8.1.210.0040.00418.79
8.1.200.0030.00617.22
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0060.00318.66
8.1.160.0000.00718.79
8.1.150.0000.00720.13
8.1.140.0080.00017.61
8.1.130.0000.00719.14
8.1.120.0030.00517.47
8.1.110.0040.00417.42
8.1.100.0000.00717.34
8.1.90.0070.00017.45
8.1.80.0040.00417.47
8.1.70.0030.00317.45
8.1.60.0000.00817.46
8.1.50.0000.00917.41
8.1.40.0000.00717.50
8.1.30.0030.00517.67
8.1.20.0080.00317.56
8.1.10.0040.00417.64
8.1.00.0060.00317.51
8.0.300.0000.00720.00
8.0.290.0050.00516.75
8.0.280.0030.00318.44
8.0.270.0050.00316.79
8.0.260.0050.00216.85
8.0.250.0040.00416.86
8.0.240.0030.00616.85
8.0.230.0030.00316.95
8.0.220.0030.00316.93
8.0.210.0070.00016.93
8.0.200.0070.00016.99
8.0.190.0000.00716.96
8.0.180.0050.00216.90
8.0.170.0040.00416.79
8.0.160.0000.00916.82
8.0.150.0040.00416.90
8.0.140.0070.00016.86
8.0.130.0030.00313.29
8.0.120.0030.00616.75
8.0.110.0020.00516.84
8.0.100.0000.00716.79
8.0.90.0050.00216.91
8.0.80.0030.01716.84
8.0.70.0000.00716.86
8.0.60.0000.00716.79
8.0.50.0030.00616.71
8.0.30.0130.00616.96
8.0.20.0090.00917.31
8.0.10.0040.01216.96
8.0.00.0110.00716.80
7.4.330.0000.00515.55
7.4.320.0070.00016.43
7.4.300.0070.00016.57
7.4.290.0030.00516.54
7.4.280.0000.00716.48
7.4.270.0000.00816.53
7.4.260.0070.00016.61
7.4.250.0030.00616.43
7.4.240.0030.00316.59
7.4.230.0050.00216.58
7.4.220.0060.00316.53
7.4.210.0000.01416.62
7.4.200.0000.00716.66
7.4.160.0060.01016.53
7.4.150.0090.00817.01
7.4.140.0090.00817.58
7.4.130.0090.00916.53
7.4.120.0090.01116.58
7.4.110.0090.00916.50
7.4.100.0050.01016.53
7.4.90.0100.00716.44
7.4.80.0080.01117.96
7.4.70.0090.00716.33
7.4.60.0080.01016.42
7.4.50.0070.00716.42
7.4.40.0090.01016.40
7.4.30.0110.00416.39
7.4.20.0030.01016.57
7.4.10.0070.00716.50
7.4.00.0070.00915.68
7.3.330.0000.00513.16
7.3.320.0030.00313.24
7.3.310.0040.00416.41
7.3.300.0070.00016.37
7.3.290.0100.00716.36
7.3.280.0080.00816.31
7.3.270.0100.00916.84
7.3.260.0090.00716.42
7.3.250.0070.00716.27
7.3.240.0070.01016.42
7.3.230.0090.00716.40
7.3.220.0070.00716.34
7.3.210.0100.00616.44
7.3.200.0070.00816.29
7.3.190.0040.01116.41
7.3.180.0080.00716.44
7.3.170.0090.00916.31
7.3.160.0050.01016.41
7.3.150.0070.00716.33
7.3.140.0040.00816.21
7.3.130.0070.00716.32
7.3.120.0120.00616.19
7.3.110.0030.01516.14
7.3.100.0030.01016.15
7.3.90.0070.00716.53
7.3.80.0120.00616.30
7.3.70.0070.01016.43
7.3.60.0030.01016.38
7.3.50.0000.01416.47
7.3.40.0090.00616.39
7.3.30.0110.00416.39
7.3.20.0150.00018.28
7.3.10.0090.00918.14
7.3.00.0040.01118.18
7.2.340.0040.01416.36
7.2.330.0050.01316.52
7.2.320.0150.00616.59
7.2.310.0100.01216.55
7.2.300.0100.01216.50
7.2.290.0140.00916.53
7.2.280.0160.00816.36
7.2.270.0160.00816.33
7.2.260.0250.00016.34
7.2.250.0170.01416.44
7.2.240.0120.01816.36
7.2.230.0140.01116.37
7.2.220.0210.00716.38
7.2.210.0250.00816.47
7.2.200.0090.01816.71
7.2.190.0140.01416.52
7.2.180.0170.00716.56
7.2.170.0170.00716.54
7.2.160.0190.01016.53
7.2.150.0210.01218.48
7.2.140.0200.00918.53
7.2.130.0150.01618.62
7.2.120.0200.00718.47
7.2.110.0210.00518.55
7.2.100.0220.00418.47
7.2.90.0270.00618.38
7.2.80.0120.00717.66
7.2.70.0210.01118.39
7.2.60.0110.00817.63
7.2.50.0180.00718.37
7.2.40.0140.01118.50
7.2.30.0210.00418.45
7.2.20.0140.01019.14
7.2.10.0160.01019.13
7.2.00.0130.00919.21
7.1.330.0290.00615.68
7.1.320.0160.00615.62
7.1.310.0180.01217.33
7.1.300.0140.01417.32
7.1.290.0240.00317.42
7.1.280.0200.00317.36
7.1.270.0150.00817.37
7.1.260.0120.01217.36
7.1.250.0190.00617.27
7.1.240.0180.00517.23
7.1.230.0160.00817.33
7.1.220.0170.00917.31
7.1.210.0180.00917.45
7.1.200.0090.01116.60
7.1.190.0130.01117.39
7.1.180.0170.00617.32
7.1.170.0150.00717.37
7.1.160.0160.00717.30
7.1.150.0230.00717.25
7.1.140.0130.01117.95
7.1.130.0130.01017.98
7.1.120.0110.01118.07
7.1.110.0140.01017.63
7.1.100.0150.00717.71
7.1.90.0120.01017.75
7.1.80.0100.01217.60
7.1.70.0120.01017.20
7.1.60.0200.01526.30
7.1.50.0190.01626.16
7.1.40.0250.01025.96
7.1.30.0230.00825.92
7.1.20.0210.01226.03
7.1.10.0100.01016.97
7.1.00.0160.00417.09
7.0.330.0250.00016.96
7.0.320.0150.01116.86
7.0.310.0230.00317.01
7.0.300.0120.00916.95
7.0.290.0150.00817.05
7.0.280.0280.00316.88
7.0.270.0140.01116.96
7.0.260.0170.00617.03
7.0.250.0170.01117.06
7.0.240.0180.00917.23
7.0.230.0070.01817.13
7.0.220.0260.00616.99
7.0.210.0160.00817.07
7.0.200.0210.00317.09
7.0.190.0170.00817.03
7.0.180.0130.01317.11
7.0.170.0280.00017.04
7.0.160.0170.00717.02
7.0.150.0170.01016.94
7.0.140.0150.01117.12
7.0.130.0120.01017.15
7.0.120.0170.01017.11
7.0.110.0180.00716.97
7.0.100.0200.00317.02
7.0.90.0170.01016.89
7.0.80.0180.00816.98
7.0.70.0190.00616.93
7.0.60.0120.02017.07
7.0.50.0140.01016.96
7.0.40.0090.02217.06
7.0.30.0130.01317.03
7.0.20.0180.00417.00
7.0.10.0160.00917.04
7.0.00.0170.00816.98
5.6.400.0200.00715.82
5.6.390.0130.01315.84
5.6.380.0140.01115.82
5.6.370.0230.00415.84
5.6.360.0180.00415.82
5.6.350.0160.01015.86
5.6.340.0230.00515.78
5.6.330.0120.01215.94
5.6.320.0120.01215.82
5.6.310.0170.00715.78
5.6.300.0150.01115.79
5.6.290.0170.00815.80
5.6.280.0190.00415.82
5.6.270.0170.01015.77
5.6.260.0110.01415.83
5.6.250.0140.00915.80
5.6.240.0130.01016.00
5.6.230.0180.00615.94
5.6.220.0340.00316.04
5.6.210.0220.01015.99
5.6.200.0140.01416.00
5.6.190.0170.01115.99
5.6.180.0180.01116.02
5.6.170.0170.01216.14
5.6.160.0120.01616.09
5.6.150.0240.00316.06
5.6.140.0140.00916.02
5.6.130.0210.00416.08
5.6.120.0120.01216.18
5.6.110.0150.00716.01
5.6.100.0200.00315.88
5.6.90.0180.00415.99
5.6.80.0110.01115.87
5.6.70.0080.01515.82
5.6.60.0150.01215.91
5.6.50.0220.00015.82
5.6.40.0120.01015.95
5.6.30.0100.01416.04
5.6.20.0110.01315.80
5.6.10.0130.00915.91
5.6.00.0200.00315.91

preferences:
133.31 ms | 403 KiB | 5 Q