3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doLoad(array $weights, $remainingWeight, array $sequence = []) { if ($remainingWeight === 0) { return [$sequence]; } if (empty($weights)) { return []; } $container = array_shift($weights); $sequences = doLoad($weights, $remainingWeight, $sequence); if ($container <= $remainingWeight) { $sequence[] = $container; $sequences = array_merge($sequences, $this->doLoad($weights, ($remainingWeight - $container), $sequence)); } return $sequences; } $weights = [ 1, 3, 5, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113 ]; var_dump(doLoad($weights, 381));

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.0070.00716.75
8.3.50.0140.00521.26
8.3.40.0140.00418.87
8.3.30.0150.00018.94
8.3.20.0080.00020.32
8.3.10.0030.00521.91
8.3.00.0080.00023.66
8.2.180.0030.01518.29
8.2.170.0090.00622.96
8.2.160.0070.00720.47
8.2.150.0030.00524.18
8.2.140.0070.00024.66
8.2.130.0080.00019.57
8.2.120.0000.00726.35
8.2.110.0170.00422.15
8.2.100.0100.00317.72
8.2.90.0040.00419.05
8.2.80.0090.00017.97
8.2.70.0090.00017.62
8.2.60.0080.00017.93
8.2.50.0050.00318.07
8.2.40.0090.00020.41
8.2.30.0000.00819.48
8.2.20.0040.00417.79
8.2.10.0030.00518.15
8.2.00.0030.00518.20
8.1.280.0070.00725.92
8.1.270.0050.00323.94
8.1.260.0040.00428.09
8.1.250.0090.00028.09
8.1.240.0110.01123.67
8.1.230.0110.00021.17
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0090.00017.25
8.1.180.0050.00318.10
8.1.170.0030.00618.73
8.1.160.0070.00020.68
8.1.150.0000.00818.93
8.1.140.0040.00419.56
8.1.130.0000.00717.58
8.1.120.0080.00017.54
8.1.110.0050.00317.51
8.1.100.0000.00717.47
8.1.90.0000.00717.36
8.1.80.0040.00417.37
8.1.70.0070.00017.43
8.1.60.0040.00417.63
8.1.50.0030.00617.48
8.1.40.0000.00717.55
8.1.30.0030.00517.62
8.1.20.0040.00417.59
8.1.10.0040.00417.50
8.1.00.0060.00317.44
8.0.300.0040.00418.77
8.0.290.0030.00616.88
8.0.280.0040.00418.43
8.0.270.0040.00417.25
8.0.260.0030.00317.26
8.0.250.0000.00717.01
8.0.240.0000.00716.94
8.0.230.0000.00717.05
8.0.220.0000.00816.96
8.0.210.0070.00016.85
8.0.200.0000.00617.04
8.0.190.0090.00316.96
8.0.180.0030.00516.91
8.0.170.0000.00817.02
8.0.160.0000.00717.09
8.0.150.0060.00316.89
8.0.140.0070.00016.91
8.0.130.0060.00313.38
8.0.120.0000.00816.98
8.0.110.0040.00416.96
8.0.100.0040.00416.92
8.0.90.0040.00416.93
8.0.80.0030.01216.91
8.0.70.0040.00416.89
8.0.60.0030.00316.86
8.0.50.0000.00717.00
8.0.30.0070.01017.25
8.0.20.0070.01317.40
8.0.10.0000.00817.13
8.0.00.0080.01116.82
7.4.330.0060.00016.83
7.4.320.0030.00316.57
7.4.300.0000.00716.66
7.4.290.0030.00316.64
7.4.280.0100.00016.48
7.4.270.0030.00316.63
7.4.260.0000.00716.52
7.4.250.0030.00616.44
7.4.240.0040.00416.64
7.4.230.0000.00716.39
7.4.220.0150.00316.49
7.4.210.0060.00816.48
7.4.200.0070.00016.48
7.4.160.0120.00316.57
7.4.150.0130.00717.40
7.4.140.0080.01017.86
7.4.130.0070.01116.58
7.4.120.0100.00716.51
7.4.110.0130.00316.71
7.4.100.0150.00716.74
7.4.90.0140.00316.74
7.4.80.0110.00719.39
7.4.70.0060.00916.55
7.4.60.0130.00816.49
7.4.50.0100.00716.72
7.4.40.0100.00716.49
7.4.30.0100.00716.64
7.4.00.0100.00014.91
7.3.330.0030.00313.46
7.3.320.0070.00013.55
7.3.310.0000.00716.51
7.3.300.0030.00316.33
7.3.290.0060.01216.52
7.3.280.0120.00616.50
7.3.270.0140.00317.40
7.3.260.0110.00616.48
7.3.240.0070.01016.47
7.3.230.0070.01016.55
7.3.210.0070.01116.60
7.3.200.0100.01019.39
7.3.190.0090.00916.47
7.3.180.0100.00716.29
7.3.170.0070.01016.38
7.3.160.0030.01316.39
7.2.330.0100.01016.57
7.2.320.0120.00416.67
7.2.310.0030.01316.82
7.2.300.0060.01016.76
7.2.290.0070.01016.61
7.2.60.0090.00616.95
7.2.00.0090.00619.32
7.1.200.0000.00915.88
7.1.100.0030.01018.46
7.1.70.0000.00817.29
7.1.60.0070.01719.30
7.1.50.0000.01817.11
7.1.00.0030.07722.46
7.0.200.0000.01016.58
7.0.60.0100.03721.82
7.0.50.0000.04717.95
7.0.40.0100.03720.24
7.0.30.0530.06720.16
7.0.20.0230.08320.05
7.0.10.0170.07720.06
7.0.00.0070.05020.24
5.6.280.0030.06720.98
5.6.210.0200.07320.81
5.6.200.0100.08318.17
5.6.190.0100.08720.57
5.6.180.0470.07020.48
5.6.170.0370.07320.55
5.6.160.0130.05020.47
5.6.150.0070.08318.30
5.6.140.0100.07718.25
5.6.130.0130.08018.25
5.6.120.0030.05021.11
5.6.110.0030.08721.06
5.6.100.0170.07721.03
5.6.90.0070.05721.07
5.6.80.0000.05720.43
5.5.350.0200.07720.52
5.5.340.0170.03018.08
5.5.330.0030.04320.31
5.5.320.0330.07320.27
5.5.310.0330.07020.27
5.5.300.0070.08018.05
5.5.290.0030.08318.02
5.5.280.0100.04320.81
5.5.270.0200.07020.93
5.5.260.0100.06020.94
5.5.250.0030.07020.70
5.5.240.0130.03720.42

preferences:
91.41 ms | 401 KiB | 5 Q