3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["type"=>"WOW","order_no"=>1,"value"=>10], ["type"=>"WOW","order_no"=>8,"value"=>20], ["type"=>"DLR","order_no"=>10,"value"=>100], ["type"=>"DLR","order_no"=>2,"value"=>50], ["type"=>"WOW","order_no"=>3, "value"=>25] ]; $totalorders = 0; $totalvalue = 0; $final = array(); foreach($array as $k=>$v) { $custype = isset($v['type']) ? $v['type'] : null; $ordervalue = isset($v['value']) ? $v['value'] : null; if (!isset($final[$custype])) { $final[$custype] = array('orderdollars' => $ordervalue, 'ordercount' => 1); } else { $final[$custype]["orderdollars"] = $final[$custype]["orderdollars"] + $ordervalue; $final[$custype]["ordercount"]++; } $totalorders++; } print_r($final);

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.70.0130.00316.63
8.3.60.0110.00718.55
8.3.50.0070.00716.39
8.3.40.0090.00918.79
8.3.30.0040.01118.77
8.3.20.0080.00020.60
8.3.10.0080.00022.09
8.3.00.0080.00022.36
8.2.190.0070.01116.58
8.2.180.0070.01018.54
8.2.170.0120.00922.96
8.2.160.0110.00421.96
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0000.00820.96
8.2.110.0030.00621.10
8.2.100.0090.00317.91
8.2.90.0050.00317.75
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0060.00617.63
8.2.50.0000.00817.93
8.2.40.0000.00819.78
8.2.30.0040.00419.34
8.2.20.0000.00718.04
8.2.10.0040.00419.53
8.2.00.0070.00019.34
8.1.280.0080.00825.92
8.1.270.0060.00323.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00617.36
8.1.230.0090.00319.17
8.1.220.0090.00017.78
8.1.210.0060.00318.77
8.1.200.0040.00417.36
8.1.190.0000.00817.13
8.1.180.0030.00618.10
8.1.170.0030.00517.62
8.1.160.0040.00418.86
8.1.150.0000.00818.90
8.1.140.0000.00820.30
8.1.130.0000.00720.22
8.1.120.0040.00417.53
8.1.110.0000.00817.38
8.1.100.0030.00317.46
8.1.90.0030.00717.46
8.1.80.0040.00417.42
8.1.70.0000.00717.55
8.1.60.0030.00517.54
8.1.50.0000.00817.54
8.1.40.0030.00617.45
8.1.30.0040.00417.58
8.1.20.0040.00417.73
8.1.10.0000.00717.50
8.1.00.0000.00817.52
8.0.300.0000.00719.60
8.0.290.0040.00416.75
8.0.280.0000.00718.53
8.0.270.0050.00317.36
8.0.260.0040.00420.09
8.0.250.0000.00817.02
8.0.240.0030.00316.93
8.0.230.0070.00016.99
8.0.220.0000.00716.90
8.0.210.0030.00316.93
8.0.200.0030.00317.02
8.0.190.0000.00716.83
8.0.180.0040.00416.82
8.0.170.0030.00616.92
8.0.160.0030.00516.92
8.0.150.0040.00416.91
8.0.140.0040.00416.91
8.0.130.0060.00013.39
8.0.120.0040.00416.90
8.0.110.0000.00716.94
8.0.100.0000.00717.03
8.0.90.0080.00016.76
8.0.80.0040.01816.87
8.0.70.0060.00316.92
8.0.60.0070.00016.72
8.0.50.0050.00216.90
8.0.30.0070.01016.96
8.0.20.0140.00517.25
8.0.10.0070.00016.95
8.0.00.0070.01016.76
7.4.330.0020.00215.55
7.4.320.0000.00616.59
7.4.300.0030.00316.63
7.4.290.0030.00516.60
7.4.280.0040.00416.57
7.4.270.0030.00616.66
7.4.260.0050.00013.34
7.4.250.0040.00416.59
7.4.240.0040.00416.60
7.4.230.0020.00516.34
7.4.220.0050.00216.56
7.4.210.0060.01116.56
7.4.200.0040.00416.43
7.4.130.0100.00716.46
7.4.120.0070.01116.61
7.4.110.0100.00716.70
7.4.100.0030.01416.49
7.4.90.0100.00716.58
7.4.80.0070.01019.39
7.4.70.0070.01416.34
7.4.60.0090.00916.51
7.4.50.0060.00916.56
7.4.40.0070.01016.53
7.4.00.0070.00914.96
7.3.330.0060.00316.23
7.3.320.0000.00613.16
7.3.310.0030.00316.26
7.3.300.0070.00016.37
7.3.290.0000.00716.39
7.3.260.0110.01016.51
7.3.240.0080.00916.42
7.3.230.0090.00916.54
7.3.210.0090.01416.33
7.3.200.0100.00616.44
7.3.190.0140.00316.20
7.3.180.0040.01216.63
7.3.170.0150.00316.39
7.3.160.0060.01016.25
7.3.120.0110.00314.77
7.3.110.0080.00814.77
7.3.100.0070.00814.50
7.3.90.0310.00814.65
7.3.80.0070.00914.62
7.3.70.0100.00714.40
7.3.60.0100.00614.41
7.3.50.0050.01114.61
7.3.40.0200.01114.73
7.3.30.0070.00614.38
7.3.20.0380.00715.15
7.3.10.0390.01115.10
7.3.00.0550.00815.24
7.2.330.0030.01416.58
7.2.320.0090.00816.70
7.2.310.0070.01016.81
7.2.300.0060.01216.84
7.2.290.0130.00316.73
7.2.250.0030.01315.05
7.2.240.0130.00615.13
7.2.230.0030.01014.90
7.2.220.0280.01214.80
7.2.210.0080.00914.96
7.2.200.0050.01214.97
7.2.190.0060.01114.76
7.2.180.0100.00714.57
7.2.170.0110.00814.96
7.2.160.0120.00414.60
7.2.150.0370.01114.57
7.2.140.0370.00714.82
7.2.130.0200.00714.74
7.2.120.0690.00914.46
7.2.110.0300.00814.53
7.2.100.0620.00914.53
7.2.90.0320.00614.91
7.2.80.0300.00614.65
7.2.70.0540.00514.73
7.2.60.0420.00814.70
7.2.50.0340.01015.12
7.2.40.0510.00315.12
7.2.30.0280.00915.02
7.2.20.0260.00615.02
7.2.10.0460.01415.02
7.2.00.0330.01114.77
7.1.330.0030.01015.83
7.1.320.0370.00614.41
7.1.310.0550.00814.59
7.1.300.0400.00714.40
7.1.290.0330.00814.31
7.1.280.0250.00814.32
7.1.270.0160.01014.29
7.1.260.0380.00914.41
7.1.250.0520.00713.55

preferences:
15.1 ms | 401 KiB | 5 Q