3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ [1,3], [1,6], [7,8] ]; $available = [6=>0, 1=>1]; //product $result = array_reduce(array_slice($input, 1), function($c, $x) { return call_user_func_array('array_merge', array_map(function($y) use ($c) { return array_map(function($z) use ($y) { return array_merge((array)$z, (array)$y); }, $c); }, $x) ); }, current($input)); //filter: $result = array_filter($result, function($tuple) use ($available) { foreach(array_count_values($tuple) as $value=>$count) { if(isset($available[$value]) && $available[$value]<$count) { return false; } } return true; }); var_dump($result);

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.0140.00718.32
8.3.50.0200.00521.99
8.3.40.0110.00418.97
8.3.30.0140.00018.82
8.3.20.0040.00420.29
8.3.10.0040.00423.69
8.3.00.0040.00420.88
8.2.180.0030.01318.41
8.2.170.0090.00622.96
8.2.160.0070.00720.53
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0050.00320.80
8.2.110.0030.00622.17
8.2.100.0070.00420.52
8.2.90.0090.00019.26
8.2.80.0040.00417.97
8.2.70.0000.00917.75
8.2.60.0000.00818.04
8.2.50.0040.00418.07
8.2.40.0000.00820.07
8.2.30.0080.00318.41
8.2.20.0000.00717.71
8.2.10.0070.00018.08
8.2.00.0060.00317.81
8.1.280.0100.00725.92
8.1.270.0040.00423.84
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00424.02
8.1.230.0110.00018.97
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0040.00417.36
8.1.190.0030.00617.25
8.1.180.0040.00418.10
8.1.170.0050.00518.59
8.1.160.0040.00422.05
8.1.150.0050.00318.67
8.1.140.0040.00417.41
8.1.130.0030.00317.81
8.1.120.0040.00417.40
8.1.110.0040.00417.55
8.1.100.0040.00417.48
8.1.90.0040.00417.47
8.1.80.0000.00817.55
8.1.70.0030.00317.38
8.1.60.0050.00317.64
8.1.50.0030.00617.60
8.1.40.0040.00417.57
8.1.30.0060.00317.64
8.1.20.0070.00017.64
8.1.10.0030.00617.64
8.1.00.0040.00417.43
8.0.300.0020.00518.77
8.0.290.0000.00716.63
8.0.280.0040.00418.51
8.0.270.0000.00717.18
8.0.260.0030.00317.29
8.0.250.0000.00716.97
8.0.240.0000.00817.04
8.0.230.0000.00716.96
8.0.220.0000.00816.83
8.0.210.0000.00716.90
8.0.200.0060.00016.96
8.0.190.0000.00816.96
8.0.180.0000.00816.95
8.0.170.0000.00916.97
8.0.160.0000.00716.96
8.0.150.0020.00516.75
8.0.140.0030.00516.82
8.0.130.0030.00313.35
8.0.120.0070.00016.82
8.0.110.0000.00716.85
8.0.100.0040.00416.89
8.0.90.0000.00716.73
8.0.80.0060.00916.93
8.0.70.0040.00416.97
8.0.60.0080.00016.73
8.0.50.0000.00716.95
8.0.30.0090.01117.13
8.0.20.0150.00917.40
8.0.10.0050.00217.04
8.0.00.0060.01316.76
7.4.330.0000.00515.00
7.4.320.0000.00616.47
7.4.300.0000.00616.64
7.4.290.0070.00016.67
7.4.280.0040.00416.66
7.4.270.0000.00716.59
7.4.260.0030.00316.52
7.4.250.0050.00216.40
7.4.240.0060.00216.63
7.4.230.0000.00716.43
7.4.220.0120.00916.52
7.4.210.0110.00316.58
7.4.200.0000.00716.52
7.4.160.0090.00916.54
7.4.150.0110.00717.40
7.4.140.0090.00917.86
7.4.130.0150.00416.54
7.4.120.0040.01216.61
7.4.110.0260.02616.41
7.4.100.0070.01016.61
7.4.90.0070.01116.65
7.4.80.0090.00919.39
7.4.70.0000.01616.52
7.4.60.0090.01216.59
7.4.50.0020.00216.26
7.4.40.0080.00816.32
7.4.30.0100.00716.60
7.4.00.0000.01214.90
7.3.330.0060.00313.24
7.3.320.0040.00413.17
7.3.310.0000.00816.44
7.3.300.0030.00516.29
7.3.290.0090.00916.32
7.3.280.0160.00416.25
7.3.270.0120.00917.40
7.3.260.0040.01316.29
7.3.250.0150.00516.37
7.3.240.0150.00316.42
7.3.230.0100.00716.48
7.3.210.0090.00916.41
7.3.200.0100.01119.39
7.3.190.0070.01016.61
7.3.180.0100.01016.55
7.3.170.0040.01416.52
7.3.160.0120.00616.53
7.3.120.0090.00914.88
7.2.330.0150.00316.94
7.2.320.0100.00716.82
7.2.310.0140.00316.47
7.2.300.0070.01016.75
7.2.290.0080.00816.87
7.2.60.0070.00716.96
7.2.00.0100.00719.37
7.1.200.0070.00715.96
7.1.100.0000.01218.15
7.1.70.0000.00816.99
7.1.60.0150.00919.70
7.1.50.0160.01016.91
7.1.00.0000.08022.40
7.0.200.0220.00316.34
7.0.140.0070.07022.15
7.0.60.0030.04019.95
7.0.50.0070.08317.89
7.0.40.0030.04320.02
7.0.30.0130.04320.21
7.0.20.0200.08320.21
7.0.10.0370.07020.21
7.0.00.0100.04320.07
5.6.280.0100.07021.13
5.6.210.0030.06320.62
5.6.200.0100.07718.27
5.6.190.0030.05320.82
5.6.180.4070.04020.56
5.6.170.0430.07020.50
5.6.160.0030.09020.50
5.6.150.0070.08018.15
5.6.140.0000.04318.18
5.6.130.0070.07718.14
5.6.120.0100.06321.03
5.6.110.0070.08721.01
5.6.100.0030.07321.00
5.6.90.0130.07721.12
5.6.80.0130.05020.38
5.6.70.0270.07020.40
5.5.350.0130.04720.43
5.5.340.0070.03717.96
5.5.330.0100.07020.23
5.5.320.0530.07020.47
5.5.310.0400.07720.32
5.5.300.0070.07017.95
5.5.290.0000.04317.98
5.5.280.0000.04320.89
5.5.270.0030.09320.98
5.5.260.0130.05020.86
5.5.250.0030.04320.59
5.5.240.0030.08020.14
5.4.450.0800.06019.61
5.4.440.0700.07019.17
5.4.430.0730.05019.46
5.4.420.0630.00019.51
5.4.410.0130.06018.99
5.4.400.0230.05718.82
5.4.390.0370.05318.80
5.4.380.0300.05018.57
5.4.370.0130.05018.79
5.4.360.0130.03318.59
5.4.350.0080.04912.04
5.4.340.0110.04612.03
5.4.320.0040.03812.51
5.4.310.0070.03712.51
5.4.300.0070.05412.52
5.4.290.0100.05412.51
5.4.280.0050.05412.41
5.4.270.0070.05012.41
5.4.260.0100.05112.41
5.4.250.0050.05712.41
5.4.240.0110.05012.41
5.4.230.0070.05412.41
5.4.220.0090.05112.40
5.4.210.0060.05212.41
5.4.200.0080.05312.40
5.4.190.0090.05212.40
5.4.180.0060.05412.40
5.4.170.0050.05512.41
5.4.160.0090.04712.40
5.4.150.0070.04512.40
5.4.140.0100.03912.08
5.4.130.0050.04612.07
5.4.120.0060.05312.03
5.4.110.0100.05212.03
5.4.100.0120.04612.03
5.4.90.0090.05112.03
5.4.80.0100.05012.02
5.4.70.0130.04612.02
5.4.60.0060.05012.02
5.4.50.0110.03812.02
5.4.40.0090.03712.01
5.4.30.0060.04412.00
5.4.20.0070.04512.00
5.4.10.0060.04712.00
5.4.00.0080.04711.50
5.3.290.0060.04112.80
5.3.280.0170.04012.71
5.3.270.0160.04412.72
5.3.260.0140.04612.72
5.3.250.0080.05012.72
5.3.240.0200.05312.72
5.3.230.0150.04812.71
5.3.220.0150.04412.68
5.3.210.0130.05712.68
5.3.200.0090.04012.68
5.3.190.0090.03912.68
5.3.180.0050.04012.68
5.3.170.0080.04012.67
5.3.160.0090.03912.67
5.3.150.0060.04312.68
5.3.140.0100.04312.66
5.3.130.0070.05512.65
5.3.120.0040.05812.65
5.3.110.0060.05512.66
5.3.100.0050.05312.12
5.3.90.0070.05212.08
5.3.80.0090.04812.07
5.3.70.0070.04912.08
5.3.60.0150.04212.07
5.3.50.0090.04812.00
5.3.40.0120.04512.00
5.3.30.0060.05211.95
5.3.20.0060.05011.72
5.3.10.0060.05111.70
5.3.00.0070.05111.68
5.2.170.0100.0399.18
5.2.160.0080.0409.18
5.2.150.0050.0449.18
5.2.140.0090.0419.18
5.2.130.0100.0399.14
5.2.120.0060.0439.14
5.2.110.0030.0449.14
5.2.100.0120.0549.14
5.2.90.0090.0439.14
5.2.80.0110.0549.14
5.2.70.0150.0739.14
5.2.60.0070.0429.09
5.2.50.0070.0299.06
5.2.40.0080.0269.04
5.2.30.0040.0329.01
5.2.20.0050.0319.00
5.2.10.0090.0428.92
5.2.00.0080.0398.79
5.1.60.0060.0228.07
5.1.50.0050.0268.06
5.1.40.0050.0258.05
5.1.30.0040.0268.40
5.1.20.0060.0258.42
5.1.10.0040.0278.14
5.1.00.0050.0348.14
5.0.50.0070.0296.62
5.0.40.0050.0296.48
5.0.30.0080.0466.29
5.0.20.0040.0216.26
5.0.10.0030.0236.24
5.0.00.0030.0356.24
4.4.90.0010.0204.78
4.4.80.0060.0174.75
4.4.70.0060.0214.75
4.4.60.0080.0794.75
4.4.50.0030.0264.77
4.4.40.0090.0524.71
4.4.30.0080.0394.76
4.4.20.0050.0224.85
4.4.10.0010.0244.85
4.4.00.0110.0424.76
4.3.110.0060.0234.67
4.3.100.0040.0224.66
4.3.90.0090.0334.64
4.3.80.0030.0324.59
4.3.70.0050.0294.63
4.3.60.0090.0344.63
4.3.50.0130.0194.63
4.3.40.0040.0354.54
4.3.30.0020.0223.28
4.3.20.0020.0223.26
4.3.10.0010.0203.22
4.3.00.0100.0236.83

preferences:
39.02 ms | 401 KiB | 5 Q