3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=[ ['day'=>'11','movements'=>'1'], ['day'=>'11','movements'=>'1'], ['day'=>'11','movements'=>'1'], ['day'=>'12','movements'=>'1'], ['day'=>'12','movements'=>'1'], ['day'=>'12','movements'=>'1'] ]; foreach($array as $row){ // iterate all rows if(!isset($result[$row['day']])){ // if first occurrence of day... $result[$row['day']]=$row; // save the full row with day as the temporary key }else{ // if not the first occurrence of day... $result[$row['day']]['movements']+=$row['movements']; // add movements 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.3.60.0140.00718.43
8.3.50.0120.00616.41
8.3.40.0140.00718.67
8.3.30.0060.01218.84
8.3.20.0000.00720.25
8.3.10.0090.00023.44
8.3.00.0030.00619.78
8.2.180.0130.00625.92
8.2.170.0110.00318.96
8.2.160.0200.00022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00419.39
8.2.120.0040.00426.35
8.2.110.0080.00022.20
8.2.100.0070.00317.97
8.2.90.0040.00418.16
8.2.80.0090.00017.63
8.2.70.0050.00317.63
8.2.60.0040.00418.05
8.2.50.0040.00718.07
8.2.40.0030.00518.16
8.2.30.0040.00418.15
8.2.20.0040.00418.01
8.2.10.0040.00418.15
8.2.00.0040.00418.31
8.1.280.0090.01225.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.79
8.1.230.0090.00322.48
8.1.220.0050.00317.91
8.1.210.0080.00018.98
8.1.200.0030.00717.35
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0050.00318.46
8.1.160.0050.00318.77
8.1.150.0000.00720.19
8.1.140.0050.00217.78
8.1.130.0060.00019.07
8.1.120.0000.00717.47
8.1.110.0000.00717.48
8.1.100.0030.00317.46
8.1.90.0000.00817.36
8.1.80.0000.00717.45
8.1.70.0000.00717.50
8.1.60.0000.00817.56
8.1.50.0050.00317.46
8.1.40.0030.00517.49
8.1.30.0030.00517.57
8.1.20.0030.00917.63
8.1.10.0000.00817.42
8.1.00.0000.00817.53
8.0.300.0030.00520.02
8.0.290.0000.00716.75
8.0.280.0030.00318.45
8.0.270.0020.00516.75
8.0.260.0020.00516.89
8.0.250.0000.00716.92
8.0.240.0040.00416.88
8.0.230.0000.00716.84
8.0.220.0030.00316.82
8.0.210.0000.00716.83
8.0.200.0050.00316.97
8.0.190.0050.00316.97
8.0.180.0080.00016.81
8.0.170.0040.00416.92
8.0.160.0060.00316.97
8.0.150.0030.00616.86
8.0.140.0040.00416.91
8.0.130.0000.00513.28
8.0.120.0000.00816.85
8.0.110.0070.00016.68
8.0.100.0030.00416.93
8.0.90.0080.00016.90
8.0.80.0080.00616.84
8.0.70.0030.00516.93
8.0.60.0060.00216.83
8.0.50.0040.00416.84
8.0.30.0070.00716.98
8.0.20.0100.00717.33
8.0.10.0020.00616.93
8.0.00.0090.00616.75
7.4.330.0000.00515.55
7.4.320.0030.00316.62
7.4.300.0060.00016.56
7.4.290.0000.00716.41
7.4.280.0000.00816.64
7.4.270.0040.00416.54
7.4.260.0030.00316.49
7.4.250.0000.00716.49
7.4.240.0000.00716.44
7.4.230.0050.00216.61
7.4.220.0040.00316.58
7.4.210.0060.00916.56
7.4.200.0040.00416.69
7.4.190.0000.00716.51
7.4.180.0000.00816.46
7.4.160.0070.00816.60
7.4.150.0050.00717.01
7.4.140.0090.00717.60
7.4.130.0060.00616.46
7.4.120.0100.00816.52
7.4.110.0070.00816.54
7.4.100.0070.00516.45
7.4.90.0050.00716.47
7.4.80.0090.00917.93
7.4.70.0060.00716.33
7.4.60.0050.00716.48
7.4.50.0070.00316.43
7.4.40.0060.00616.53
7.4.30.0000.00716.52
7.4.20.0060.00916.54
7.4.10.0050.00716.42
7.4.00.0040.01016.05
7.3.330.0020.00213.24
7.3.320.0000.00613.08
7.3.310.0000.00716.23
7.3.300.0020.00516.26
7.3.290.0040.00316.18
7.3.280.0080.00816.31
7.3.270.0050.00816.87
7.3.260.0060.01016.43
7.3.250.0000.00716.21
7.3.240.0080.00716.30
7.3.230.0110.00116.41
7.3.220.0080.00016.16
7.3.210.0070.00516.35
7.3.200.0030.00916.49
7.3.190.0060.00616.26
7.3.180.0050.00916.43
7.3.170.0050.00816.31
7.3.160.0060.00516.27
7.3.150.0000.00716.24
7.3.140.0000.00716.25
7.3.130.0090.00416.25
7.3.120.0030.00816.34
7.3.110.0050.00616.29
7.3.100.0080.00416.14
7.3.90.0050.00516.44
7.3.80.0020.00916.22
7.3.70.0050.00316.38
7.3.60.0040.00716.44
7.3.50.0020.00816.37
7.3.40.0050.00816.38
7.3.30.0080.00316.29
7.3.20.0030.00618.12
7.3.10.0040.00518.17
7.3.00.0050.00718.09
7.2.340.0060.00316.29
7.2.330.0060.00716.51
7.2.320.0030.01016.36
7.2.310.0070.00516.42
7.2.300.0070.00616.35
7.2.290.0030.00916.57
7.2.280.0040.00416.18
7.2.270.0040.00416.32
7.2.260.0080.00616.43
7.2.250.0030.01116.36
7.2.240.0030.00816.51
7.2.230.0100.00216.52
7.2.220.0040.00516.40
7.2.210.0040.00616.48
7.2.200.0050.00616.48
7.2.190.0060.00516.50
7.2.180.0050.00516.48
7.2.170.0020.00916.57
7.2.160.0030.00716.42
7.2.150.0070.00218.42
7.2.140.0020.00718.43
7.2.130.0070.00618.58
7.2.120.0050.00518.48
7.2.110.0050.00818.40
7.2.100.0050.00718.40
7.2.90.0040.00918.48
7.2.80.0030.00817.87
7.2.70.0030.00618.33
7.2.60.0040.00618.03
7.2.50.0080.00318.39
7.2.40.0030.00818.57
7.2.30.0080.00518.39
7.2.20.0090.00818.37
7.2.10.0080.00818.27
7.2.00.0380.00818.21
7.1.330.0020.01117.38
7.1.320.0000.01117.21
7.1.310.0050.00617.18
7.1.300.0040.00617.48
7.1.290.0030.00517.38
7.1.280.0060.00217.41
7.1.270.0070.00317.31
7.1.260.0040.00617.36
7.1.250.0040.00717.39
7.1.240.0070.00217.28
7.1.230.0060.00417.33
7.1.220.0050.00517.25
7.1.210.0030.00717.38
7.1.200.0040.00716.75
7.1.190.0050.00517.23
7.1.180.0060.00317.26
7.1.170.0070.00317.33
7.1.160.0050.00817.38
7.1.150.0070.00517.19
7.1.140.0040.01017.16
7.1.130.0070.00817.15
7.1.120.0070.00917.16
7.1.110.0050.01016.99
7.1.100.0050.00917.00
7.1.90.0090.00516.86
7.1.80.0140.00516.94
7.1.70.0080.00616.71
7.1.60.0120.01022.58
7.1.50.0140.00722.58
7.1.40.0140.00822.42
7.1.30.0110.01122.59
7.1.20.0130.01022.40
7.1.10.0030.01016.50
7.1.00.0050.00916.32
7.0.330.0060.00316.98
7.0.320.0020.00816.91
7.0.310.0060.00617.02
7.0.300.0020.00616.94
7.0.290.0030.00916.86
7.0.280.0080.00216.93
7.0.270.0050.00617.00
7.0.260.0030.00916.89
7.0.250.0060.00417.11
7.0.240.0040.00616.90
7.0.230.0030.00516.99
7.0.220.0000.01217.03
7.0.210.0060.00516.99
7.0.200.0030.00616.98
7.0.190.0020.00916.95
7.0.180.0040.00816.96
7.0.170.0010.01217.06
7.0.160.0060.00716.96
7.0.150.0030.00516.94
7.0.140.0050.00616.90
7.0.130.0030.00716.94
7.0.120.0060.00316.90
7.0.110.0030.00616.82
7.0.100.0040.00616.88
7.0.90.0080.00316.93
7.0.80.0020.00817.01
7.0.70.0000.01117.02
7.0.60.0070.00416.97
7.0.50.0030.00516.90
7.0.40.0040.00515.99
7.0.30.0060.00515.95
7.0.20.0040.00715.92
7.0.10.0060.00515.98
7.0.00.0040.00315.98
5.6.400.0070.00515.93
5.6.390.0040.00516.05
5.6.380.0030.00715.98
5.6.370.0060.00616.03
5.6.360.0020.00616.11
5.6.350.0030.01015.73
5.6.340.0090.00215.86
5.6.330.0060.00615.90
5.6.320.0070.00415.83
5.6.310.0040.00815.87
5.6.300.0040.00715.67
5.6.290.0030.00616.02
5.6.280.0080.00315.82
5.6.270.0040.00515.98
5.6.260.0040.00715.63
5.6.250.0000.00815.86
5.6.240.0030.00616.08
5.6.230.0000.01015.96
5.6.220.0080.00515.98
5.6.210.0070.00415.93
5.6.200.0000.00915.96
5.6.190.0070.00316.04
5.6.180.0040.00616.04
5.6.170.0050.00616.00
5.6.160.0050.00516.05
5.6.150.0080.00215.94
5.6.140.0060.00616.02
5.6.130.0070.00515.90
5.6.120.0090.00315.98
5.6.110.0040.00715.87
5.6.100.0030.00715.94
5.6.90.0050.00515.79
5.6.80.0050.00615.69
5.6.70.0030.00615.90
5.6.60.0040.00715.89
5.6.50.0070.00415.76
5.6.40.0070.00315.86
5.6.30.0020.00815.86
5.6.20.0030.00515.77
5.6.10.0070.00416.03
5.6.00.0000.01015.89

preferences:
57.26 ms | 401 KiB | 5 Q