3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_array = [ ["cust_id" => 1006, "no_of_subs" => 2, "dlv_id" => 1000], ["cust_id" => 1011, "no_of_subs" => 3, "dlv_id" => 1000], ["cust_id" => 1012, "no_of_subs" => 5, "dlv_id" => 1001], ["cust_id" => 1013, "no_of_subs" => 6, "dlv_id" => 1001] ]; $dlv_id = array_column($input_array, 'dlv_id', 'cust_id'); // get all no_of_subs maintaining the cust_id as index $no_of_subs = array_column($input_array, 'no_of_subs', 'cust_id'); $output = array(); foreach ($dlv_id as $key => $value) { if (isset($output[$value]['dlv_id'])) { $output[$value]['dlv_id'] += $no_of_subs[$key]; } else { $output[$value]['dlv_id'] += $no_of_subs[$key]; } } var_export($output);

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.00.0150.00620.04
8.4.150.0030.00014.05
8.4.140.0140.00717.68
8.4.130.0100.00917.70
8.4.120.0130.00722.41
8.4.110.0160.00520.83
8.4.100.0140.00718.07
8.4.90.0120.00820.67
8.4.80.0020.00619.07
8.4.70.0140.00620.65
8.4.60.0140.00718.81
8.4.50.0060.00320.11
8.4.40.0000.00917.95
8.4.30.0070.00317.91
8.4.20.0140.00720.35
8.4.10.0070.01317.63
8.3.280.0110.01018.66
8.3.270.0130.00816.89
8.3.260.0040.00516.69
8.3.250.0100.00918.98
8.3.240.0100.00916.70
8.3.230.0120.00616.93
8.3.220.0050.00319.13
8.3.210.0100.00818.56
8.3.200.0040.00516.90
8.3.190.0110.00617.41
8.3.180.0090.01118.88
8.3.170.0110.00719.20
8.3.160.0040.01518.46
8.3.150.0120.00319.23
8.3.140.0140.00420.46
8.3.130.0090.00018.66
8.3.120.0050.00318.80
8.3.110.0050.00320.94
8.3.100.0090.00024.06
8.3.90.0080.00626.77
8.3.80.0090.00016.88
8.3.70.0140.00716.63
8.3.60.0150.00618.28
8.3.50.0060.00818.16
8.3.40.0070.00718.68
8.3.30.0070.01118.66
8.3.20.0030.00518.51
8.3.10.0000.00821.91
8.3.00.0070.00723.50
8.2.290.0120.00720.64
8.2.280.0070.00820.22
8.2.270.0090.00916.93
8.2.260.0140.00317.28
8.2.250.0040.00416.73
8.2.240.0040.00417.27
8.2.230.0090.00022.58
8.2.220.0110.00837.54
8.2.210.0040.00426.77
8.2.200.0060.00316.88
8.2.190.0120.00316.88
8.2.180.0120.00625.92
8.2.170.0120.00319.07
8.2.160.0100.00322.96
8.2.150.0070.00725.66
8.2.140.0000.00824.66
8.2.130.0000.00821.04
8.2.120.0040.00426.35
8.2.110.0120.00921.11
8.2.100.0080.00417.89
8.2.90.0060.00319.70
8.2.80.0030.00817.97
8.2.70.0040.00417.91
8.2.60.0060.00318.02
8.2.50.0000.00818.05
8.2.40.0000.00918.05
8.2.30.0000.00720.68
8.2.20.0070.00318.18
8.2.10.0000.00718.01
8.2.00.0040.00418.21
8.1.330.0110.00816.62
8.1.320.0100.00916.27
8.1.310.0000.00918.33
8.1.300.0040.00419.65
8.1.290.0060.00618.88
8.1.280.0090.00925.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0140.00028.09
8.1.240.0030.00623.92
8.1.230.0040.00722.81
8.1.220.0050.00317.74
8.1.210.0100.00318.77
8.1.200.0080.00417.00
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0000.00717.65
8.1.160.0000.00718.89
8.1.150.0040.00418.82
8.1.140.0040.00418.96
8.1.130.0030.00517.46
8.1.120.0030.00717.43
8.1.110.0070.00017.40
8.1.100.0000.00817.37
8.1.90.0040.00417.53
8.1.80.0030.00617.47
8.1.70.0040.00417.50
8.1.60.0030.00517.62
8.1.50.0080.00017.46
8.1.40.0040.00417.44
8.1.30.0030.00817.52
8.1.20.0070.00017.61
8.1.10.0040.00417.56
8.1.00.0050.00317.43
8.0.300.0040.00419.74
8.0.290.0000.00816.75
8.0.280.0000.00718.46
8.0.270.0000.00816.97
8.0.260.0000.00616.81
8.0.250.0090.00017.03
8.0.240.0030.00316.97
8.0.230.0030.00316.98
8.0.220.0040.00416.90
8.0.210.0050.00317.03
8.0.200.0060.00017.02
8.0.190.0070.00016.90
8.0.180.0030.00616.95
8.0.170.0000.00816.99
8.0.160.0000.00716.93
8.0.150.0050.00216.88
8.0.140.0000.00716.95
8.0.130.0060.00013.35
8.0.120.0030.00516.95
8.0.110.0000.00716.82
8.0.100.0040.00416.84
8.0.90.0050.00316.86
8.0.80.0120.00317.00
8.0.70.0050.00216.95
8.0.60.0050.00216.98
8.0.50.0080.00016.97
8.0.30.0080.01117.13
8.0.20.0150.00317.40
8.0.10.0050.00216.89
8.0.00.0110.00716.74
7.4.330.0000.00515.55
7.4.320.0040.00416.55
7.4.300.0000.00816.41
7.4.290.0000.00716.53
7.4.280.0040.00416.51
7.4.270.0030.00316.53
7.4.260.0060.00316.48
7.4.250.0040.00416.61
7.4.240.0040.00416.66
7.4.230.0030.00516.60
7.4.220.0040.00416.61
7.4.210.0060.00916.68
7.4.200.0040.00416.41
7.4.160.0120.00416.53
7.4.140.0120.00617.86
7.4.130.0090.00916.74
7.4.120.0100.00716.54
7.4.110.0070.01016.65
7.4.100.0080.00816.54
7.4.90.0120.00616.57
7.4.80.0170.00019.39
7.4.70.0090.00916.45
7.4.60.0130.00316.50
7.4.50.0030.01416.21
7.4.40.0080.00816.46
7.4.00.0040.01415.13
7.3.330.0020.00213.25
7.3.320.0000.00513.38
7.3.310.0000.00716.40
7.3.300.0070.00016.41
7.3.290.0030.00316.43
7.3.280.0060.00916.34
7.3.260.0110.00816.43
7.3.240.0090.01116.46
7.3.230.0130.00316.42
7.3.210.0080.00816.56
7.3.200.0110.00916.38
7.3.190.0110.01316.52
7.3.180.0070.01016.57
7.3.170.0060.00916.34
7.3.160.0130.00916.43
7.3.10.0090.00316.91
7.3.00.0100.00016.85
7.2.330.0090.00916.85
7.2.320.0070.01016.71
7.2.310.0130.01016.53
7.2.300.0000.01716.69
7.2.290.0140.00816.54
7.2.130.0070.00416.70
7.2.120.0060.00616.86
7.2.110.0000.01116.91
7.2.100.0750.00815.99
7.2.90.0260.01215.66
7.2.80.0370.00815.97
7.2.70.0310.00615.91
7.2.60.0290.00816.07
7.2.50.0300.00816.01
7.2.40.0270.00815.94
7.2.30.0370.01015.79
7.2.20.0380.01016.14
7.2.10.0400.00915.88
7.2.00.0320.01015.93
7.1.250.0030.00716.00
7.1.220.0720.00713.95
7.1.210.0600.00313.93
7.1.200.1390.00613.90
7.1.190.0520.01013.73
7.1.180.0770.00314.09
7.1.170.0710.01013.88
7.1.160.0710.00914.02
7.1.150.0500.01213.93
7.1.140.0770.01013.89
7.1.130.0760.00913.77
7.1.120.0640.00314.08
7.1.110.0600.00314.09
7.1.100.0640.00614.04
7.1.90.0610.00913.89
7.1.80.0630.00913.70
7.1.70.0840.00614.08
7.1.60.1010.01032.09
7.1.50.1010.00631.60
7.1.40.1020.00031.91
7.1.30.1070.00332.02
7.1.20.0930.01931.79
7.1.10.2190.00314.00
7.1.00.0630.00913.49
5.6.380.0070.01414.40

preferences:
31.59 ms | 403 KiB | 5 Q