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] . ' '; } } //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.0130.00316.38
8.3.50.0090.00721.99
8.3.40.0090.00618.70
8.3.30.0070.01118.86
8.3.20.0040.00420.25
8.3.10.0060.00323.71
8.3.00.0000.00817.89
8.2.180.0130.00716.50
8.2.170.0110.00422.96
8.2.160.0070.00720.53
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00420.96
8.2.110.0030.00620.27
8.2.100.0090.00317.91
8.2.90.0050.00319.30
8.2.80.0000.00817.97
8.2.70.0060.00317.34
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0050.00318.34
8.2.30.0080.00318.23
8.2.20.0050.00317.64
8.2.10.0080.00018.11
8.2.00.0020.00517.69
8.1.280.0100.01325.92
8.1.270.0060.00323.93
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0050.00518.60
8.1.230.0110.00019.15
8.1.220.0060.00317.79
8.1.210.0080.00018.77
8.1.200.0090.00317.35
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0030.00618.59
8.1.160.0000.00721.99
8.1.150.0030.00318.91
8.1.140.0030.00517.35
8.1.130.0000.00717.73
8.1.120.0050.00317.47
8.1.110.0040.00417.46
8.1.100.0080.00017.46
8.1.90.0000.00817.48
8.1.80.0050.00317.38
8.1.70.0000.00717.43
8.1.60.0040.00417.62
8.1.50.0040.00417.54
8.1.40.0060.00317.56
8.1.30.0060.00317.60
8.1.20.0000.00817.66
8.1.10.0030.00517.60
8.1.00.0000.00817.47
8.0.300.0070.00018.77
8.0.290.0040.00416.61
8.0.280.0040.00418.44
8.0.270.0000.00717.16
8.0.260.0060.00017.17
8.0.250.0030.00316.94
8.0.240.0000.00716.97
8.0.230.0070.00016.98
8.0.220.0000.01016.86
8.0.210.0000.00716.90
8.0.200.0000.00616.98
8.0.190.0050.00316.90
8.0.180.0050.00316.81
8.0.170.0040.00416.93
8.0.160.0030.00516.85
8.0.150.0000.00716.89
8.0.140.0030.00616.81
8.0.130.0030.00313.30
8.0.120.0040.00416.75
8.0.110.0040.00416.86
8.0.100.0030.00516.91
8.0.90.0000.00716.84
8.0.80.0030.01216.95
8.0.70.0020.00516.74
8.0.60.0020.00516.89
8.0.50.0030.00616.90
8.0.30.0090.01217.06
8.0.20.0130.00817.40
8.0.10.0040.00417.03
8.0.00.0080.00816.68
7.4.330.0050.00015.00
7.4.320.0030.00316.64
7.4.300.0030.00316.41
7.4.290.0020.00516.55
7.4.280.0020.00516.54
7.4.270.0070.00016.49
7.4.260.0040.00416.47
7.4.250.0000.00716.45
7.4.240.0030.00316.56
7.4.230.0030.00316.58
7.4.220.0090.00616.54
7.4.210.0000.01516.37
7.4.200.0000.00716.37
7.4.160.0050.01116.58
7.4.150.0100.00717.40
7.4.140.0100.00817.86
7.4.130.0080.00916.52
7.4.120.0060.01116.56
7.4.110.0100.01316.38
7.4.100.0070.01016.57
7.4.90.0110.01116.60
7.4.80.0100.01219.39
7.4.70.0120.00616.40
7.4.60.0070.01016.29
7.4.50.0000.00416.64
7.4.40.0030.01316.60
7.4.30.0100.00716.31
7.4.00.0050.01214.99
7.3.330.0050.00013.17
7.3.320.0000.00513.09
7.3.310.0070.00016.31
7.3.300.0030.00316.28
7.3.290.0030.01116.26
7.3.280.0100.00916.23
7.3.270.0070.01017.40
7.3.260.0060.01216.41
7.3.250.0150.00516.38
7.3.240.0070.01116.43
7.3.230.0100.01016.46
7.3.210.0040.01316.30
7.3.200.0100.00719.39
7.3.190.0170.01016.35
7.3.180.0070.01016.44
7.3.170.0100.00716.41
7.3.160.0090.00916.48
7.3.120.0100.00914.87
7.3.110.0090.00814.77
7.3.100.0050.00814.85
7.3.90.0050.00814.68
7.3.80.0090.00814.84
7.3.70.0130.00314.86
7.3.60.0100.00914.86
7.3.50.0050.00814.88
7.3.40.0070.00714.65
7.3.30.0080.00414.85
7.3.20.0070.00816.48
7.3.10.0070.00716.64
7.3.00.0030.00916.72
7.2.330.0000.01816.30
7.2.320.0080.01116.79
7.2.310.0060.01016.72
7.2.300.0090.00916.77
7.2.290.0100.01016.73
7.2.250.0110.00514.94
7.2.240.0080.01114.95
7.2.230.0130.00315.06
7.2.220.0080.00615.13
7.2.210.0050.01214.95
7.2.200.0030.01115.11
7.2.190.0050.01015.08
7.2.180.0070.00715.16
7.2.170.0080.00515.01
7.2.130.0070.00516.97
7.2.120.0020.01016.94
7.2.110.0010.01016.76
7.2.100.0050.01016.94
7.2.90.0020.00917.02
7.2.80.0050.00917.05
7.2.70.0050.00517.05
7.2.60.0040.00916.93
7.2.50.0060.00616.89
7.2.40.0080.00317.02
7.2.30.0070.00616.95
7.2.20.0050.01116.97
7.2.10.0060.00816.90
7.2.00.0030.00717.82
7.1.330.0030.01015.65
7.1.320.0040.00815.73
7.1.310.0030.00915.71
7.1.300.0090.00715.84
7.1.290.0040.01015.73
7.1.280.0070.00615.77
7.1.270.0100.00515.84
7.1.260.0070.00415.87
7.1.250.0070.00715.95
7.1.200.0060.00615.90
7.1.100.0070.00718.11
7.1.70.0000.01116.96
7.1.60.0090.01519.25
7.1.50.0040.01817.14
7.1.00.0070.07322.36
7.0.200.0240.00316.59
7.0.140.0070.06722.21
7.0.60.0030.08319.86
7.0.50.0070.08017.77
7.0.40.0170.05319.96
7.0.30.0370.07020.02
7.0.20.0330.03720.21
7.0.10.0130.07020.30
7.0.00.0130.05019.99
5.6.280.0070.07021.02
5.6.210.0070.08720.69
5.6.200.0130.03318.26
5.6.190.0070.08720.65
5.6.180.0200.06320.33
5.6.170.0200.03720.38
5.6.160.0030.08720.62
5.6.150.0030.04018.22
5.6.140.0130.07318.21
5.6.130.0030.04018.11
5.6.120.0070.08321.14
5.6.110.0170.07321.01
5.6.100.0130.05020.99
5.6.90.0130.08021.09
5.6.80.0100.08020.39
5.5.350.0330.07020.42
5.5.340.0000.09018.00
5.5.330.0170.05720.14
5.5.320.0100.04720.18
5.5.310.0130.05320.41
5.5.300.0130.04317.91
5.5.290.0070.07717.98
5.5.280.0070.07020.73
5.5.270.0030.06320.83
5.5.260.0100.07320.81
5.5.250.0100.08320.58
5.5.240.0000.08020.27
5.4.450.0830.05319.59
5.4.440.1070.06019.32
5.4.430.1100.07019.13
5.4.420.1070.06019.57
5.4.410.0070.06019.02
5.4.400.0330.06018.79
5.4.390.0370.07318.50
5.4.380.0270.05318.70
5.4.370.0070.04018.68
5.4.360.0030.04018.63
5.4.350.0070.03811.97
5.4.340.0060.04311.97
5.4.320.0040.04212.45
5.4.310.0040.04012.45
5.4.300.0030.03912.46
5.4.290.0050.03812.45
5.4.280.0040.03512.35
5.4.270.0090.04712.35
5.4.260.0040.03912.35
5.4.250.0040.03812.35
5.4.240.0060.03512.35
5.4.230.0070.03712.34
5.4.220.0060.03512.34
5.4.210.0050.03612.34
5.4.200.0040.04012.34
5.4.190.0050.03912.34
5.4.180.0070.04112.34
5.4.170.0030.03812.35
5.4.160.0090.03412.34
5.4.150.0050.03812.34
5.4.140.0050.04112.03
5.4.130.0050.03612.02
5.4.120.0070.03811.97
5.4.110.0040.03611.97
5.4.100.0040.03711.97
5.4.90.0040.03911.96
5.4.80.0060.03611.96
5.4.70.0050.03611.96
5.4.60.0040.03811.96
5.4.50.0060.03611.96
5.4.40.0060.03511.95
5.4.30.0060.03611.95
5.4.20.0060.03411.95
5.4.10.0030.03711.95
5.4.00.0060.03711.44
5.3.290.0100.03512.80
5.3.280.0050.03912.71
5.3.270.0050.04012.72
5.3.260.0060.03912.72
5.3.250.0060.03812.72
5.3.240.0050.03812.72
5.3.230.0060.03812.71
5.3.220.0080.04212.68
5.3.210.0050.04012.68
5.3.200.0070.03612.68
5.3.190.0120.04112.68
5.3.180.0050.03712.68
5.3.170.0080.03412.67
5.3.160.0080.05112.67
5.3.150.0060.03912.68
5.3.140.0070.04412.66
5.3.130.0110.05212.66
5.3.120.0050.04712.66
5.3.110.0060.04112.66
5.3.100.0070.03812.12
5.3.90.0030.04512.09
5.3.80.0080.04112.07
5.3.70.0070.03512.08
5.3.60.0060.03612.07
5.3.50.0040.03912.00
5.3.40.0040.03812.00
5.3.30.0040.03611.94
5.3.20.0080.03311.73
5.3.10.0060.03511.69
5.3.00.0090.03311.68
5.2.170.0070.0299.18
5.2.160.0020.0329.18
5.2.150.0060.0299.18
5.2.140.0050.0319.17
5.2.130.0060.0299.14
5.2.120.0060.0289.13
5.2.110.0040.0309.14
5.2.100.0030.0309.14
5.2.90.0100.0299.14
5.2.80.0050.0359.14
5.2.70.0050.0329.14
5.2.60.0050.0399.09
5.2.50.0050.0309.06
5.2.40.0060.0279.03
5.2.30.0090.0269.01
5.2.20.0050.0309.00
5.2.10.0020.0318.92
5.2.00.0060.0288.78
5.1.60.0050.0278.07
5.1.50.0070.0248.06
5.1.40.0050.0248.04
5.1.30.0040.0268.39
5.1.20.0080.0248.41
5.1.10.0060.0258.14
5.1.00.0060.0238.14
5.0.50.0040.0206.61
5.0.40.0020.0226.48
5.0.30.0030.0326.29
5.0.20.0020.0206.26
5.0.10.0020.0216.24
5.0.00.0040.0306.23
4.4.90.0040.0184.78
4.4.80.0020.0164.75
4.4.70.0010.0174.75
4.4.60.0020.0164.75
4.4.50.0040.0144.77
4.4.40.0010.0274.71
4.4.30.0030.0154.75
4.4.20.0030.0154.85
4.4.10.0020.0164.85
4.4.00.0040.0244.76
4.3.110.0020.0164.67
4.3.100.0010.0184.66
4.3.90.0040.0154.63
4.3.80.0020.0254.58
4.3.70.0030.0144.63
4.3.60.0010.0164.63
4.3.50.0040.0144.63
4.3.40.0030.0254.53
4.3.30.0040.0203.32
4.3.20.0020.0193.30
4.3.10.0000.0183.25
4.3.00.0130.0207.21

preferences:
35.09 ms | 401 KiB | 5 Q