3v4l.org

run code in 300+ PHP versions simultaneously
<?php function combinations(int $n, int $k):array { function combine(int $n, int $k, int $start = 0, array &$result = [], array &$all = []) { if ($k == 0) { $all[] = $result; return; } for ($i = $start; $i <= $n - $k; $i++) { $result[$k] = $i; combine($n, $k - 1, $i + 1, $result, $all); } } $res = []; $all = []; combine($n, $k, 0, $res, $all); return $all; } function may_add_combination_to_set(array $combination, array $sets) { foreach ($sets as $combinationInSet) { if (count(array_intersect($combinationInSet, $combination)) !== 1) { return false; } } return true; } $combinations = combinations(31, 6); $sets = []; foreach ($combinations as $combination) { if (may_add_combination_to_set($combination, $sets)) { $sets[] = $combination; } } count($sets);

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.0640.09476.89
8.3.50.0570.07776.96
8.3.40.0170.03743.76
8.3.30.0260.04243.55
8.3.20.0130.02445.07
8.3.10.0210.01046.51
8.3.00.0030.02646.78
8.2.180.0950.05977.04
8.2.170.0600.02048.02
8.2.160.0400.01749.14
8.2.150.0140.01847.72
8.2.140.0160.01049.45
8.2.130.0270.01348.23
8.2.120.0100.01050.39
8.2.110.0310.01448.30
8.2.100.0270.02046.91
8.2.90.0240.01448.17
8.2.80.0140.02446.25
8.2.70.0140.02546.50
8.2.60.0110.02546.55
8.2.50.0170.04246.25
8.2.40.0230.02949.47
8.2.30.0220.01948.41
8.2.20.0220.01946.73
8.2.10.0170.02046.90
8.2.00.0150.02646.94
8.1.280.0580.04774.80
8.1.270.0170.01747.93
8.1.260.0280.00648.28
8.1.250.0120.01246.55
8.1.240.0130.02045.08
8.1.230.0200.02743.70
8.1.220.0200.01043.66
8.1.210.0170.01443.23
8.1.200.0100.02343.38
8.1.190.0070.02343.21
8.1.180.0100.02043.23
8.1.170.0130.02044.53
8.1.160.0170.01746.46
8.1.150.0160.01644.66
8.1.140.0130.01745.40
8.1.130.0100.02043.48
8.1.120.0160.01643.27
8.1.110.0070.02343.30
8.1.100.0100.02043.19
8.1.90.0200.01343.18
8.1.80.0100.02343.23
8.1.70.0100.02143.14
8.1.60.0190.02543.42
8.1.50.0170.01743.25
8.1.40.0100.02743.19
8.1.30.0070.02543.26
8.1.20.0200.02043.33
8.1.10.0200.05675.80
8.1.00.0440.03175.72
8.0.300.0190.03875.38
8.0.290.0260.03774.91
8.0.280.0170.04376.49
8.0.270.0320.02975.33
8.0.260.0280.03575.24
8.0.250.0260.03675.17
8.0.240.0240.03875.14
8.0.230.0160.04075.11
8.0.220.0390.02675.09
8.0.210.0290.03374.97
8.0.200.0300.03775.09
8.0.190.0270.04475.16
8.0.180.0390.04675.16
8.0.170.0400.04074.98
8.0.160.0390.03975.15
8.0.150.0270.04675.16
8.0.140.0300.04775.14
8.0.130.0570.120130.27
8.0.120.0190.04875.09
8.0.110.0180.05375.02
8.0.100.0100.05575.17
8.0.90.0260.04675.20
8.0.80.0500.09775.20
8.0.70.0260.03675.09
8.0.60.0310.03475.09
8.0.50.0200.04875.22
8.0.30.0600.06275.27
8.0.20.0760.08475.27
8.0.10.0260.03975.31
8.0.00.0620.08275.01
7.4.330.0240.02773.50
7.4.320.0230.04074.50
7.4.300.0230.03974.45
7.4.290.0290.04674.61
7.4.280.0430.04274.62
7.4.270.0300.03674.61
7.4.260.0300.04074.50
7.4.250.0330.03774.45
7.4.240.0200.04774.59
7.4.230.0230.04674.49
7.4.220.0820.08974.68
7.4.210.0520.07074.70
7.4.200.0230.04374.71
7.4.160.0600.07074.84
7.4.150.0790.08674.96
7.4.140.0890.11274.94
7.4.130.0700.08074.56
7.4.120.0730.08774.83
7.4.110.0490.09274.62
7.4.100.0490.09574.62
7.4.90.0820.08274.73
7.4.80.0830.06774.75
7.4.70.0620.08274.90
7.4.60.0710.08874.71
7.4.50.0230.08274.36
7.4.40.0660.07874.85
7.4.30.0740.13474.71
7.4.00.0460.07272.84
7.3.330.0700.113130.36
7.3.320.0630.139130.30
7.3.310.0230.04774.62
7.3.300.0260.04374.62
7.3.290.0170.04774.46
7.3.280.0710.07674.61
7.3.270.0630.09274.66
7.3.260.0570.09374.82
7.3.250.0640.09774.57
7.3.240.0690.08274.87
7.3.230.0390.11574.59
7.3.210.0740.09074.74
7.3.200.0500.10674.75
7.3.190.0600.10274.91
7.3.180.0560.12574.56
7.3.170.0630.09474.77
7.3.160.0680.10774.73
7.2.330.0620.21974.49
7.2.320.0960.18474.84
7.2.310.0700.17274.73
7.2.300.0680.17374.77
7.2.290.0620.18474.81
7.2.112.4490.09064.90
7.2.80.1660.10674.61
7.2.60.1780.11774.91
7.2.00.6150.11476.26
7.1.200.0820.10274.07
7.1.100.8280.12276.35
7.1.70.0870.15075.47
7.1.60.0130.16575.79
7.1.50.0270.15475.45
7.1.00.0070.19780.46
7.0.200.3780.12372.81
7.0.60.1430.17378.09
7.0.50.0300.13775.93
7.0.40.0070.20327.89
7.0.30.0770.18728.11
7.0.20.0630.17328.19
7.0.10.0170.13028.14
7.0.00.0030.15327.98
5.6.280.0030.04021.08
5.6.210.0000.04720.48
5.6.200.0130.04718.20
5.6.190.0070.07720.58
5.6.180.0230.08320.63
5.6.170.0400.07720.55
5.6.160.0030.04320.48
5.6.150.0170.07018.16
5.6.140.0030.08318.21
5.6.130.0030.07018.20
5.6.120.0070.04321.12
5.6.110.0000.06321.01
5.6.100.0000.08721.00
5.6.90.0030.04021.00
5.6.80.0030.07020.37
5.5.350.0200.05320.41
5.5.340.0070.03717.99
5.5.330.0100.07720.37
5.5.320.0200.05320.38
5.5.310.0330.07020.38
5.5.300.0100.07718.04
5.5.290.0070.07017.98
5.5.280.0000.09320.89
5.5.270.0030.07720.97
5.5.260.0030.04720.79
5.5.250.0070.07720.50
5.5.240.0130.08320.15

preferences:
55.04 ms | 400 KiB | 5 Q