3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('A', 'B'); $array2 = array('1', '2', '3'); $num = count($array2); //The total number of possible combinations $total = pow(2, $num); $temp = array(); //Loop through each possible combination for ($i = 0; $i < $total; $i++) { //For each combination check if each bit is set for ($j = 0; $j < $num; $j++) { //Is bit $j set in $i? if (pow(2, $j) & $i) echo $array2[$j] . ' '; } echo '<br />'; } //print_r($temp);

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.0100.00716.50
8.3.50.0080.01021.98
8.3.40.0110.00718.64
8.3.30.0070.00718.96
8.3.20.0070.00020.39
8.3.10.0040.00423.52
8.3.00.0030.00618.00
8.2.180.0120.00318.42
8.2.170.0110.00422.96
8.2.160.0070.00720.46
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00221.02
8.2.110.0030.00920.38
8.2.100.0090.00317.78
8.2.90.0000.00819.76
8.2.80.0000.00819.15
8.2.70.0080.00018.16
8.2.60.0060.00318.22
8.2.50.0000.00718.10
8.2.40.0070.00020.65
8.2.30.0120.00018.29
8.2.20.0050.00317.61
8.2.10.0000.00818.14
8.2.00.0000.00717.69
8.1.280.0090.00625.92
8.1.270.0090.00023.83
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0000.00924.02
8.1.230.0040.00817.42
8.1.220.0030.00517.78
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0030.00618.50
8.1.160.0040.00418.86
8.1.150.0040.00418.79
8.1.140.0000.00717.38
8.1.130.0000.00717.85
8.1.120.0000.00717.43
8.1.110.0040.00417.45
8.1.100.0030.00417.44
8.1.90.0040.00417.40
8.1.80.0050.00317.45
8.1.70.0040.00417.31
8.1.60.0060.00317.60
8.1.50.0020.00517.51
8.1.40.0000.00817.50
8.1.30.0030.00517.64
8.1.20.0040.00417.54
8.1.10.0070.00017.42
8.1.00.0050.00317.48
8.0.300.0030.00519.63
8.0.290.0080.00016.75
8.0.280.0030.00318.43
8.0.270.0070.00017.26
8.0.260.0000.00817.25
8.0.250.0070.00016.90
8.0.240.0050.00216.95
8.0.230.0000.00716.93
8.0.220.0000.00916.91
8.0.210.0070.00016.84
8.0.200.0030.00316.98
8.0.190.0030.00316.95
8.0.180.0080.00016.92
8.0.170.0040.00416.94
8.0.160.0040.00416.95
8.0.150.0070.00016.93
8.0.140.0040.00416.88
8.0.130.0060.00013.27
8.0.120.0000.00816.81
8.0.110.0040.00416.93
8.0.100.0000.00716.94
8.0.90.0030.00316.84
8.0.80.0060.00916.82
8.0.70.0000.00716.73
8.0.60.0040.00416.90
8.0.50.0040.00416.77
8.0.30.0110.00916.83
8.0.20.0160.00317.40
8.0.10.0050.00216.82
8.0.00.0120.00816.77
7.4.330.0050.00015.00
7.4.320.0030.00316.50
7.4.300.0060.00016.64
7.4.290.0000.00716.50
7.4.280.0040.00416.56
7.4.270.0070.00016.36
7.4.260.0050.00316.50
7.4.250.0040.00416.47
7.4.240.0000.00716.59
7.4.230.0030.00316.68
7.4.220.0120.00416.67
7.4.210.0100.01016.55
7.4.200.0070.00016.69
7.4.160.0090.00616.43
7.4.150.0170.00017.40
7.4.140.0120.00717.86
7.4.130.0090.01416.57
7.4.120.0050.01316.54
7.4.110.0130.01016.48
7.4.100.0090.00916.60
7.4.90.0090.00916.38
7.4.80.0060.01519.39
7.4.70.0090.00616.53
7.4.60.0110.00816.66
7.4.50.0000.00616.44
7.4.40.0070.01016.58
7.4.30.0000.01616.57
7.4.00.0000.01515.15
7.3.330.0000.00513.09
7.3.320.0000.00613.16
7.3.310.0030.00316.19
7.3.300.0000.00716.15
7.3.290.0150.00716.18
7.3.280.0070.00916.29
7.3.270.0070.01017.40
7.3.260.0090.01216.41
7.3.250.0140.00416.50
7.3.240.0130.01316.61
7.3.230.0100.00616.39
7.3.210.0070.01016.31
7.3.200.0150.00719.39
7.3.190.0030.01716.29
7.3.180.0100.00616.33
7.3.170.0070.01016.42
7.3.160.0090.00916.20
7.3.120.0040.01114.96
7.2.330.0160.00616.46
7.2.320.0150.00916.78
7.2.310.0170.00616.58
7.2.300.0120.01216.50
7.2.290.0090.00616.54
7.2.60.0400.01017.07
7.2.00.0000.01319.09
7.1.200.0030.00615.82
7.1.100.0070.00418.24
7.1.70.0040.00417.22
7.1.60.0070.01819.25
7.1.50.0100.01316.85
7.1.00.0070.07322.35
7.0.200.0180.01116.50
7.0.140.0030.06721.95
7.0.60.0070.07719.85
7.0.50.0100.07317.83
7.0.40.0030.08320.14
7.0.30.0170.04320.09
7.0.20.0270.07720.20
7.0.10.0100.04020.20
7.0.00.0100.04320.09
5.6.280.0070.07020.86
5.6.210.0130.05720.61
5.6.200.0070.05018.12
5.6.190.0030.04320.32
5.6.180.0430.07020.45
5.6.170.0300.07020.46
5.6.160.0070.06720.50
5.6.150.0070.05018.12
5.6.140.0070.06318.09
5.6.130.0070.03718.15
5.6.120.0000.04321.14
5.6.110.0000.07720.98
5.6.100.0130.07321.10
5.6.90.0070.05021.10
5.6.80.0030.08020.38
5.5.350.0230.07720.47
5.5.340.0130.06717.92
5.5.330.0100.04320.21
5.5.320.0430.07320.29
5.5.310.0370.06720.18
5.5.300.0000.04017.92
5.5.290.0070.08018.00
5.5.280.0130.07020.65
5.5.270.0130.07320.78
5.5.260.0170.07320.96
5.5.250.0000.05320.79
5.5.240.0030.07720.14
5.4.450.0230.06319.50
5.4.440.0770.05019.63
5.4.430.0100.05319.45
5.4.420.0130.05319.31
5.4.410.0070.05718.85
5.4.400.0070.05718.62
5.4.390.0100.05318.74
5.4.380.0070.06718.53
5.4.370.0070.04018.77
5.4.360.0030.04018.61
5.4.350.0080.03411.97
5.4.340.0090.03511.98
5.4.320.0060.03712.46
5.4.310.0040.04112.46
5.4.300.0090.04512.45
5.4.290.0090.03812.45
5.4.280.0020.03912.35
5.4.270.0030.04012.35
5.4.260.0060.03912.35
5.4.250.0050.04012.35
5.4.240.0070.03512.35
5.4.230.0040.04112.34
5.4.220.0070.04412.34
5.4.210.0060.03512.34
5.4.200.0080.04212.34
5.4.190.0090.03412.34
5.4.180.0080.03412.34
5.4.170.0040.03812.35
5.4.160.0040.03812.34
5.4.150.0030.04012.34
5.4.140.0030.04112.02
5.4.130.0060.03612.01
5.4.120.0050.03711.97
5.4.110.0080.03411.97
5.4.100.0050.03811.96
5.4.90.0060.03611.96
5.4.80.0040.04011.96
5.4.70.0060.03611.96
5.4.60.0090.03211.96
5.4.50.0100.03211.96
5.4.40.0050.03511.95
5.4.30.0060.03511.95
5.4.20.0070.04211.95
5.4.10.0080.03811.95
5.4.00.0090.03811.44
5.3.290.0060.04712.80
5.3.280.0090.04812.71
5.3.270.0080.04212.72
5.3.260.0100.04012.71
5.3.250.0080.03812.72
5.3.240.0050.03812.72
5.3.230.0060.03712.71
5.3.220.0050.03812.68
5.3.210.0070.03812.68
5.3.200.0040.03912.68
5.3.190.0080.03512.68
5.3.180.0060.03712.67
5.3.170.0100.03512.67
5.3.160.0090.04412.67
5.3.150.0040.04012.68
5.3.140.0080.03412.66
5.3.130.0100.03512.66
5.3.120.0060.04112.66
5.3.110.0110.04312.66
5.3.100.0080.04012.12
5.3.90.0090.03412.08
5.3.80.0070.03612.07
5.3.70.0080.03512.07
5.3.60.0030.04012.06
5.3.50.0090.03412.00
5.3.40.0090.04112.00
5.3.30.0050.03811.95
5.3.20.0080.03511.72
5.3.10.0070.03711.69
5.3.00.0020.04011.68
5.2.170.0040.0329.18
5.2.160.0060.0289.18
5.2.150.0040.0319.18
5.2.140.0030.0329.17
5.2.130.0060.0299.14
5.2.120.0090.0259.13
5.2.110.0060.0349.14
5.2.100.0050.0299.14
5.2.90.0050.0299.14
5.2.80.0080.0269.13
5.2.70.0050.0309.14
5.2.60.0040.0339.08
5.2.50.0070.0429.05
5.2.40.0060.0309.04
5.2.30.0050.0319.01
5.2.20.0050.0319.00
5.2.10.0060.0278.92
5.2.00.0070.0278.78
5.1.60.0050.0248.07
5.1.50.0050.0258.06
5.1.40.0020.0268.04
5.1.30.0070.0248.39
5.1.20.0030.0288.41
5.1.10.0040.0268.14
5.1.00.0040.0268.15
5.0.50.0040.0216.62
5.0.40.0030.0216.48
5.0.30.0060.0306.29
5.0.20.0040.0196.26
5.0.10.0020.0226.24
5.0.00.0050.0296.23
4.4.90.0030.0174.78
4.4.80.0070.0184.75
4.4.70.0030.0164.75
4.4.60.0040.0184.75
4.4.50.0040.0154.77
4.4.40.0030.0254.70
4.4.30.0050.0134.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0020.0264.76
4.3.110.0030.0154.67
4.3.100.0010.0174.66
4.3.90.0040.0204.64
4.3.80.0040.0244.58
4.3.70.0020.0164.63
4.3.60.0020.0164.63
4.3.50.0010.0174.63
4.3.40.0000.0334.54
4.3.30.0020.0163.32
4.3.20.0020.0163.29
4.3.10.0010.0163.25
4.3.00.0130.0237.17

preferences:
45.44 ms | 401 KiB | 5 Q