3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array ( 0 => Array ( 'CSTNOC' => 1976, 'TOTALQTY' => 2 ), 1 => Array ( 'CSTNOC' => 5400, 'TOTALQTY' => 1 ), 2 => Array ( 'CSTNOC' => 5400, 'TOTALQTY' => 2 ) ); $new = array(); foreach($arr as $k=>$v){ $new[$v['CSTNOC']] = isset($new[$v['CSTNOC']]) ? $new[$v['CSTNOC']] + $v['TOTALQTY'] : $v['TOTALQTY']; } print_r($new);

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.0090.01217.64
8.4.130.0140.00717.54
8.4.120.0100.01020.43
8.4.110.0140.00622.36
8.4.100.0120.00917.70
8.4.90.0110.00620.70
8.4.80.0050.00519.12
8.4.70.0100.00919.05
8.4.60.0090.01122.17
8.4.50.0060.00418.62
8.4.40.0040.00417.84
8.4.30.0080.01217.66
8.4.20.0150.00420.51
8.4.10.0100.00717.43
8.3.270.0140.00516.50
8.3.260.0090.01016.53
8.3.250.0100.00918.70
8.3.240.0060.00216.79
8.3.230.0120.00616.80
8.3.220.0060.00219.09
8.3.210.0030.00516.83
8.3.200.0110.00816.84
8.3.190.0060.00217.37
8.3.180.0110.00819.16
8.3.170.0040.01516.79
8.3.160.0100.00718.60
8.3.150.0110.00716.60
8.3.140.0090.00916.48
8.3.130.0150.00416.53
8.3.120.0070.00320.71
8.3.110.0030.01216.61
8.3.100.0040.01120.36
8.3.90.0090.00026.77
8.3.80.0060.00319.36
8.3.70.0080.00818.56
8.3.60.0110.01118.15
8.3.50.0110.00518.36
8.3.40.0150.00018.52
8.3.30.0180.00318.66
8.3.20.0040.00421.73
8.3.10.0030.00623.66
8.3.00.0040.00418.00
8.2.290.0060.00317.35
8.2.280.0110.00818.28
8.2.270.0040.00716.74
8.2.260.0040.01117.05
8.2.250.0080.00018.54
8.2.240.0060.00318.15
8.2.230.0090.00320.94
8.2.220.0030.00624.06
8.2.210.0080.00026.77
8.2.200.0030.00618.88
8.2.190.0100.00618.41
8.2.180.0090.00618.29
8.2.170.0030.01019.09
8.2.160.0100.01022.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0000.00819.14
8.2.120.0040.00426.35
8.2.110.0070.00319.30
8.2.100.0040.00717.78
8.2.90.0090.00017.75
8.2.80.0040.00418.77
8.2.70.0080.00017.75
8.2.60.0000.00817.50
8.2.50.0080.00017.55
8.2.40.0040.00419.89
8.2.30.0040.00419.38
8.2.20.0040.00418.22
8.2.10.0050.00318.22
8.2.00.0030.00618.12
8.1.330.0090.00916.02
8.1.320.0100.00916.07
8.1.310.0040.00416.79
8.1.300.0090.00916.36
8.1.290.0040.00430.84
8.1.280.0110.00725.92
8.1.270.0030.00522.19
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0050.00522.01
8.1.230.0040.00820.85
8.1.220.0000.00818.64
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0040.00717.25
8.1.180.0060.00318.10
8.1.170.0040.00417.62
8.1.160.0070.00018.89
8.1.150.0000.00719.01
8.1.140.0000.00717.74
8.1.130.0030.00317.45
8.1.120.0000.00717.36
8.1.110.0070.00017.39
8.1.100.0000.00717.48
8.1.90.0040.00417.44
8.1.80.0000.00817.35
8.1.70.0050.00317.38
8.1.60.0030.00517.61
8.1.50.0000.00917.46
8.1.40.0030.00617.50
8.1.30.0060.00317.71
8.1.20.0000.01017.48
8.1.10.0080.00017.41
8.1.00.0080.00017.45
8.0.300.0030.00619.96
8.0.290.0040.00416.75
8.0.280.0080.00018.38
8.0.270.0030.00317.30
8.0.260.0030.00316.73
8.0.250.0040.00416.96
8.0.240.0000.00816.84
8.0.230.0030.00316.89
8.0.220.0090.00316.90
8.0.210.0000.00716.87
8.0.200.0000.00616.84
8.0.190.0030.00716.82
8.0.180.0070.00016.81
8.0.170.0000.00916.94
8.0.160.0050.00316.90
8.0.150.0000.00816.88
8.0.140.0000.00716.80
8.0.130.0060.00013.32
8.0.120.0000.00716.90
8.0.110.0040.00416.79
8.0.100.0000.00716.67
8.0.90.0020.00516.76
8.0.80.0090.00616.88
8.0.70.0000.00816.77
8.0.60.0070.00016.95
8.0.50.0040.00416.75
8.0.30.0080.01117.22
8.0.20.0130.00817.40
8.0.10.0040.00416.95
8.0.00.0090.01016.84
7.4.330.0020.00215.55
7.4.320.0040.00416.55
7.4.300.0030.00316.51
7.4.290.0000.00716.49
7.4.280.0040.00416.61
7.4.270.0030.00416.46
7.4.260.0080.00016.61
7.4.250.0000.00716.54
7.4.240.0040.00416.39
7.4.230.0000.00716.71
7.4.220.0000.00816.40
7.4.210.0050.01116.62
7.4.200.0000.00716.37
7.4.160.0100.01016.56
7.4.140.0100.01117.86
7.4.130.0150.01116.64
7.4.120.0070.01116.45
7.4.110.0130.00616.42
7.4.100.0130.00316.66
7.4.90.0140.00316.51
7.4.80.0100.01019.39
7.4.70.0000.01716.59
7.4.60.0060.00916.43
7.4.50.0030.01316.38
7.4.40.0030.01416.56
7.4.00.0060.00815.00
7.3.330.0060.00013.22
7.3.320.0060.00013.16
7.3.310.0070.00016.20
7.3.300.0060.00316.23
7.3.290.0070.00016.29
7.3.280.0090.01016.29
7.3.260.0060.01216.46
7.3.240.0150.00516.40
7.3.230.0100.00716.38
7.3.210.0120.00416.50
7.3.200.0000.01716.68
7.3.190.0080.00816.43
7.3.180.0140.00716.35
7.3.170.0030.01416.39
7.3.160.0100.00716.37
7.3.120.0040.01114.90
7.3.110.0030.01614.80
7.3.100.0040.01215.11
7.3.90.0070.00714.89
7.3.80.0080.00814.80
7.3.70.0040.00414.98
7.3.60.0040.01114.75
7.3.50.0030.01314.66
7.3.40.0030.00915.05
7.3.30.0120.00314.52
7.3.20.0060.00916.48
7.3.10.0130.00216.38
7.3.00.0070.01016.27
7.2.330.0120.01216.65
7.2.320.0100.01316.55
7.2.310.0060.01616.53
7.2.300.0090.00916.75
7.2.290.0080.00816.69
7.2.250.0120.00615.14
7.2.240.0090.00915.00
7.2.230.0070.01015.02
7.2.220.0060.00915.25
7.2.210.0030.01215.06
7.2.200.0040.00815.14
7.2.190.0030.01315.16
7.2.180.0070.00715.10
7.2.170.0100.00614.90
7.2.130.0100.00816.55
7.2.120.0150.00316.68
7.2.110.0110.00916.74
7.2.100.0050.01216.59
7.2.90.0100.00816.83
7.2.80.0120.00816.64
7.2.70.0030.01416.71
7.2.60.0060.01116.78
7.2.50.0160.00616.58
7.2.40.0360.01117.06
7.2.30.0340.01017.13
7.2.20.0330.00717.04
7.2.10.0320.00917.22
7.2.00.0300.00917.26
7.1.330.0100.00715.85
7.1.320.0040.01115.68
7.1.310.0030.01015.79
7.1.300.0080.00516.02
7.1.290.0040.01115.86
7.1.280.0070.00715.86
7.1.270.0030.00615.76
7.1.260.0080.00415.85
7.1.250.0050.01115.33
7.1.200.0060.00615.76
7.1.160.1390.00916.64
7.1.150.0890.00916.89
7.1.140.0970.00916.87
7.1.130.1380.01516.86
7.1.120.0770.01516.75
7.1.110.0830.01116.34
7.1.100.0650.00716.05
7.1.90.0840.01116.30
7.1.80.0610.00816.21
7.1.70.0640.01015.56
7.1.60.0780.01333.44
7.1.50.0910.01033.08
7.1.40.0600.00832.79
7.1.30.0470.01032.46
7.1.20.0490.01332.71
7.1.10.0380.00914.79
7.1.00.0460.01214.63

preferences:
31.8 ms | 403 KiB | 5 Q