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); //Loop through each possible combination for ($i = 0; $i < $total; $i++) { $ff=''; //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) $ff = $ff.''.$array2[$j]; } $temp[]=$ff; } 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.40.0040.01118.72
8.3.30.0070.00719.07
8.3.20.0040.00420.16
8.3.10.0040.00421.71
8.3.00.0060.00319.69
8.2.170.0110.00718.98
8.2.160.0100.00722.96
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.95
8.2.110.0050.00520.30
8.2.100.0040.00817.91
8.2.90.0000.00919.25
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0000.00817.80
8.2.50.0060.00318.07
8.2.40.0030.00620.07
8.2.30.0100.00018.20
8.2.20.0040.00417.73
8.2.10.0050.00218.18
8.2.00.0000.00817.65
8.1.270.0060.00323.96
8.1.260.0030.00626.35
8.1.250.0000.00828.09
8.1.240.0000.00823.86
8.1.230.0110.00019.01
8.1.220.0030.00617.76
8.1.210.0050.00318.77
8.1.200.0030.01017.23
8.1.190.0040.00417.13
8.1.180.0060.00318.10
8.1.170.0050.00318.60
8.1.160.0000.00722.02
8.1.150.0040.00418.88
8.1.140.0040.00417.45
8.1.130.0040.00417.70
8.1.120.0030.00517.37
8.1.110.0050.00317.46
8.1.100.0000.00717.53
8.1.90.0070.00017.48
8.1.80.0040.00417.49
8.1.70.0030.00317.36
8.1.60.0000.00717.47
8.1.50.0040.00417.52
8.1.40.0040.00417.48
8.1.30.0030.00517.54
8.1.20.0000.00717.66
8.1.10.0080.00017.55
8.1.00.0030.00517.52
8.0.300.0050.00318.77
8.0.290.0070.00016.75
8.0.280.0000.00718.47
8.0.270.0000.00817.16
8.0.260.0060.00017.26
8.0.250.0030.00316.92
8.0.240.0040.00416.97
8.0.230.0080.00016.92
8.0.220.0030.00616.74
8.0.210.0030.00616.93
8.0.200.0070.00016.84
8.0.190.0030.00316.91
8.0.180.0050.00316.79
8.0.170.0040.00416.77
8.0.160.0030.00516.79
8.0.150.0030.00316.73
8.0.140.0030.00616.89
8.0.130.0050.00013.33
8.0.120.0000.00816.72
8.0.110.0040.00416.79
8.0.100.0000.00816.84
8.0.90.0050.00216.86
8.0.80.0090.00616.78
8.0.70.0040.00416.95
8.0.60.0040.00416.76
8.0.50.0070.00016.89
8.0.30.0180.00517.22
8.0.20.0160.00517.40
8.0.10.0030.00617.00
8.0.00.0070.01116.68
7.4.330.0000.00615.20
7.4.320.0030.00316.59
7.4.300.0030.00316.45
7.4.290.0030.00316.59
7.4.280.0030.00516.48
7.4.270.0070.00016.57
7.4.260.0000.00713.39
7.4.250.0040.00416.46
7.4.240.0040.00416.55
7.4.230.0000.00716.68
7.4.220.0070.00716.63
7.4.210.0070.01016.54
7.4.200.0040.00416.35
7.4.160.0080.00816.58
7.4.150.0100.01017.40
7.4.140.0090.00917.86
7.4.130.0100.00616.58
7.4.120.0140.00616.58
7.4.110.0100.01016.41
7.4.100.0150.00416.65
7.4.90.0110.00616.45
7.4.80.0110.01119.39
7.4.70.0060.01016.74
7.4.60.0140.00416.56
7.4.50.0070.00016.47
7.4.40.0130.00316.57
7.4.30.0030.01316.70
7.4.00.0110.00714.79
7.3.330.0050.00013.16
7.3.320.0000.00613.01
7.3.310.0030.00316.14
7.3.300.0000.00716.32
7.3.290.0030.01016.32
7.3.280.0110.00716.26
7.3.270.0070.01117.40
7.3.260.0100.01016.63
7.3.250.0110.00616.42
7.3.240.0060.01216.50
7.3.230.0130.00716.52
7.3.210.0150.00916.30
7.3.200.0060.00919.39
7.3.190.0170.00416.29
7.3.180.0080.00816.30
7.3.170.0070.01416.37
7.3.160.0090.01216.36
7.3.120.0060.00914.91
7.3.10.0070.00716.44
7.3.00.0100.00016.51
7.2.330.0140.00416.63
7.2.320.0190.00316.64
7.2.310.0100.00716.63
7.2.300.0120.00616.70
7.2.290.0060.01016.48
7.2.130.0070.00616.74
7.2.120.0050.00716.99
7.2.110.0020.01116.79
7.2.100.0050.00616.78
7.2.90.0040.00916.81
7.2.80.0090.00316.94
7.2.70.0030.00816.98
7.2.60.0120.00416.82
7.2.50.0020.01316.88
7.2.40.0110.00316.79
7.2.30.0050.00916.96
7.2.20.0080.00716.85
7.2.10.0070.00816.98
7.2.00.0050.00817.63
7.1.250.0070.00515.82
7.1.200.0000.00915.80
7.1.100.0030.01018.39
7.1.70.0000.01017.06
7.1.60.0090.01219.25
7.1.50.0110.01416.77
7.1.00.0100.07022.37
7.0.200.0210.00716.35
7.0.140.0030.07022.02
7.0.60.0200.07020.04
7.0.50.0030.05317.85
7.0.40.0130.08320.25
7.0.30.0170.04320.02
7.0.20.0200.06320.06
7.0.10.0100.07320.25
7.0.00.0070.08320.18
5.6.210.0030.08320.71
5.6.200.0130.07718.18
5.6.190.0070.07720.60
5.6.180.0500.06320.63
5.6.170.0300.07720.44
5.6.160.0070.07320.50
5.6.150.0130.07018.25
5.6.140.0000.04318.28
5.6.130.0030.04018.27
5.6.120.0000.04320.97
5.6.110.0030.09021.11
5.6.100.0100.08020.96
5.6.90.0070.06020.95
5.6.80.0130.07720.38
5.5.350.0200.07720.38
5.5.340.0070.07018.08
5.5.330.0070.04020.42
5.5.320.0430.07020.34
5.5.310.0200.05320.41
5.5.300.0030.04018.07
5.5.290.0170.07717.91
5.5.280.0030.09320.97
5.5.270.0030.08020.86
5.5.260.0100.07720.93
5.5.250.0000.08320.46
5.5.240.0070.07720.03
5.4.450.0370.06319.17
5.4.440.0800.05019.61
5.4.430.0100.06019.32
5.4.420.0170.04719.51
5.4.410.0030.06318.92
5.4.400.0030.05718.77
5.4.390.0070.05718.77
5.4.380.0130.05018.61
5.4.370.0030.05718.77
5.4.360.0000.04318.65
5.4.350.0080.03312.00
5.4.340.0070.04112.00
5.4.320.0060.03912.48
5.4.310.0080.03612.48
5.4.300.0080.03512.48
5.4.290.0030.04212.48
5.4.280.0050.03812.38
5.4.270.0060.03712.38
5.4.260.0060.03912.38
5.4.250.0070.05112.38
5.4.240.0060.04912.38
5.4.230.0080.03612.37
5.4.220.0120.03212.37
5.4.210.0030.03812.37
5.4.200.0040.04112.37
5.4.190.0060.03712.37
5.4.180.0030.03912.37
5.4.170.0100.03112.38
5.4.160.0070.03412.38
5.4.150.0060.03912.37
5.4.140.0050.03812.05
5.4.130.0060.03812.04
5.4.120.0080.03612.00
5.4.110.0060.03512.00
5.4.100.0060.03512.00
5.4.90.0040.04311.99
5.4.80.0040.04212.00
5.4.70.0080.03611.99
5.4.60.0060.03711.99
5.4.50.0060.03512.00
5.4.40.0060.03511.98
5.4.30.0090.03911.98
5.4.20.0080.04811.98
5.4.10.0110.04411.98
5.4.00.0070.04811.47
5.3.290.0060.04412.80
5.3.280.0080.04412.71
5.3.270.0120.03512.72
5.3.260.0040.04112.72
5.3.250.0060.03912.72
5.3.240.0080.05312.72
5.3.230.0100.04912.71
5.3.220.0030.04012.68
5.3.210.0040.04112.68
5.3.200.0080.03512.68
5.3.190.0100.04912.68
5.3.180.0040.03912.68
5.3.170.0100.03412.67
5.3.160.0070.03712.67
5.3.150.0060.03812.68
5.3.140.0070.03612.66
5.3.130.0070.03912.66
5.3.120.0080.03812.66
5.3.110.0060.03912.66
5.3.100.0060.03712.12
5.3.90.0080.03512.09
5.3.80.0060.03612.08
5.3.70.0030.03912.08
5.3.60.0020.04012.06
5.3.50.0090.03412.02
5.3.40.0070.03612.02
5.3.30.0070.03411.97
5.3.20.0060.03511.75
5.3.10.0090.03211.72
5.3.00.0020.04211.70
5.2.170.0060.0309.21
5.2.160.0050.0309.21
5.2.150.0070.0299.21
5.2.140.0080.0279.21
5.2.130.0050.0289.16
5.2.120.0070.0269.17
5.2.110.0040.0309.17
5.2.100.0040.0299.16
5.2.90.0060.0279.17
5.2.80.0020.0339.16
5.2.70.0090.0269.16
5.2.60.0050.0309.11
5.2.50.0010.0349.08
5.2.40.0050.0299.06
5.2.30.0070.0279.04
5.2.20.0050.0289.03
5.2.10.0070.0268.93
5.2.00.0070.0338.80
5.1.60.0040.0278.07
5.1.50.0080.0248.06
5.1.40.0070.0228.04
5.1.30.0030.0278.39
5.1.20.0040.0288.41
5.1.10.0020.0288.14
5.1.00.0050.0248.14
5.0.50.0040.0206.63
5.0.40.0040.0186.48
5.0.30.0040.0306.30
5.0.20.0040.0186.27
5.0.10.0010.0226.25
5.0.00.0050.0296.24
4.4.90.0020.0164.78
4.4.80.0040.0144.76
4.4.70.0040.0144.75
4.4.60.0040.0154.76
4.4.50.0010.0174.77
4.4.40.0050.0234.70
4.4.30.0020.0174.76
4.4.20.0020.0174.85
4.4.10.0020.0184.85
4.4.00.0060.0224.76
4.3.110.0030.0164.67
4.3.100.0020.0164.66
4.3.90.0020.0154.63
4.3.80.0020.0254.58
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0000.0184.63
4.3.40.0020.0244.54
4.3.30.0030.0153.32
4.3.20.0020.0173.30
4.3.10.0010.0193.27
4.3.00.0130.0207.17

preferences:
42.44 ms | 400 KiB | 5 Q