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++) { //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.60.0140.00018.55
8.3.50.0100.00522.04
8.3.40.0070.01018.79
8.3.30.0030.01218.95
8.3.20.0080.00020.20
8.3.10.0000.00823.65
8.3.00.0040.00418.05
8.2.180.0060.01016.75
8.2.170.0070.00722.96
8.2.160.0040.01120.23
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00321.02
8.2.110.0090.00021.92
8.2.100.0070.00417.84
8.2.90.0000.00817.97
8.2.80.0040.00417.97
8.2.70.0040.00417.93
8.2.60.0000.00718.22
8.2.50.0080.00018.10
8.2.40.0070.00018.22
8.2.30.0030.00618.30
8.2.20.0080.00017.90
8.2.10.0080.00018.19
8.2.00.0030.00617.81
8.1.280.0070.00725.92
8.1.270.0060.00323.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00320.48
8.1.230.0070.00717.48
8.1.220.0080.00017.74
8.1.210.0000.00820.66
8.1.200.0040.00417.23
8.1.190.0050.00317.10
8.1.180.0030.00518.10
8.1.170.0040.00418.48
8.1.160.0000.00721.91
8.1.150.0000.00718.92
8.1.140.0040.00417.51
8.1.130.0080.00017.88
8.1.120.0040.00417.39
8.1.110.0040.00417.45
8.1.100.0040.00417.34
8.1.90.0000.00717.47
8.1.80.0000.00717.37
8.1.70.0000.00717.44
8.1.60.0080.00017.55
8.1.50.0000.00817.43
8.1.40.0000.00717.52
8.1.30.0030.00517.65
8.1.20.0040.00417.65
8.1.10.0000.00717.50
8.1.00.0050.00317.56
8.0.300.0030.00619.89
8.0.290.0050.00216.75
8.0.280.0070.00018.43
8.0.270.0000.00816.79
8.0.260.0000.00717.13
8.0.250.0020.00516.98
8.0.240.0080.00016.99
8.0.230.0030.00316.97
8.0.220.0050.00316.86
8.0.210.0020.00516.98
8.0.200.0030.00317.02
8.0.190.0030.00316.96
8.0.180.0040.00416.87
8.0.170.0040.00416.91
8.0.160.0040.00416.95
8.0.150.0000.00816.94
8.0.140.0090.00016.78
8.0.130.0000.00613.36
8.0.120.0020.00516.94
8.0.110.0070.00016.91
8.0.100.0000.00816.77
8.0.90.0000.00716.91
8.0.80.0090.00617.02
8.0.70.0070.00016.98
8.0.60.0070.00016.87
8.0.50.0040.00416.94
8.0.30.0110.01117.00
8.0.20.0140.00417.40
8.0.10.0000.00816.88
8.0.00.0040.01316.94
7.4.330.0050.00015.18
7.4.320.0030.00316.43
7.4.300.0000.00716.65
7.4.290.0000.00816.59
7.4.280.0000.00816.50
7.4.270.0030.00316.51
7.4.260.0030.00616.63
7.4.250.0050.00316.54
7.4.240.0020.00516.51
7.4.230.0030.00316.55
7.4.220.0060.00916.50
7.4.210.0070.00716.47
7.4.200.0000.00816.63
7.4.160.0170.00016.53
7.4.150.0130.00717.40
7.4.140.0100.00817.86
7.4.130.0050.01116.52
7.4.120.0080.00916.52
7.4.110.0030.01316.35
7.4.100.0140.00416.73
7.4.90.0090.00916.50
7.4.80.0040.02019.39
7.4.70.0160.00016.64
7.4.60.0090.00916.43
7.4.50.0030.00616.30
7.4.40.0060.00916.60
7.4.30.0070.01016.58
7.4.00.0030.01514.90
7.3.330.0050.00013.20
7.3.320.0030.00313.17
7.3.310.0000.00716.30
7.3.300.0030.00316.24
7.3.290.0030.01116.29
7.3.280.0080.00916.36
7.3.270.0030.01517.40
7.3.260.0040.02116.50
7.3.250.0090.01016.49
7.3.240.0100.00716.37
7.3.230.0120.00316.39
7.3.210.0030.01516.32
7.3.200.0100.01419.39
7.3.190.0130.01016.35
7.3.180.0040.01816.50
7.3.170.0080.00816.56
7.3.160.0030.01316.38
7.3.120.0030.01114.88
7.2.330.0090.01316.73
7.2.320.0110.00516.61
7.2.310.0100.00716.47
7.2.300.0090.00916.45
7.2.290.0130.00316.66
7.2.60.0170.01016.84
7.2.00.0060.00919.54
7.1.200.0110.00015.87
7.1.100.0090.00618.26
7.1.70.0000.00817.06
7.1.60.0100.01419.25
7.1.50.0090.01517.06
7.1.00.0000.08022.30
7.0.200.0210.00316.53
7.0.140.0100.06022.08
7.0.60.0070.08719.86
7.0.50.0030.04017.93
7.0.40.0070.04320.15
7.0.30.0230.04020.21
7.0.20.0330.07720.07
7.0.10.0270.04320.25
7.0.00.0100.07720.09
5.6.280.0070.07021.12
5.6.210.0030.04020.51
5.6.200.0130.05718.25
5.6.190.0100.07020.47
5.6.180.3900.03720.57
5.6.170.0230.06320.55
5.6.160.0030.04020.50
5.6.150.0170.07318.27
5.6.140.0070.04018.24
5.6.130.0100.04718.14
5.6.120.0100.03720.96
5.6.110.0100.08020.96
5.6.100.0100.06320.99
5.6.90.0070.03721.07
5.6.80.0170.07020.52
5.6.70.4530.03720.38
5.5.350.0170.08720.41
5.5.340.0030.04018.01
5.5.330.0030.09020.37
5.5.320.0430.06320.34
5.5.310.0170.06020.27
5.5.300.0100.07317.95
5.5.290.0130.07717.98
5.5.280.0130.06020.87
5.5.270.0170.06020.64
5.5.260.0230.07720.78
5.5.250.0070.03720.65
5.5.240.0170.06720.25
5.4.450.0170.04319.20
5.4.440.0430.05019.47
5.4.430.0100.05319.55
5.4.420.0200.04319.32
5.4.410.0100.05319.25
5.4.400.0100.05019.16
5.4.390.0070.05319.04
5.4.380.0170.06018.71
5.4.370.0070.04318.46
5.4.360.0070.03718.53
5.4.350.0050.04012.00
5.4.340.0130.05112.00
5.4.320.0100.03312.48
5.4.310.0060.03912.48
5.4.300.0080.03512.48
5.4.290.0070.04112.48
5.4.280.0060.04212.38
5.4.270.0050.03812.38
5.4.260.0060.03912.38
5.4.250.0060.03912.38
5.4.240.0050.03912.38
5.4.230.0040.04712.37
5.4.220.0060.04112.37
5.4.210.0100.03612.37
5.4.200.0090.04212.37
5.4.190.0050.03912.37
5.4.180.0090.03312.36
5.4.170.0080.03412.38
5.4.160.0060.03612.37
5.4.150.0050.03712.37
5.4.140.0080.03712.05
5.4.130.0050.03812.04
5.4.120.0030.03912.00
5.4.110.0090.03511.99
5.4.100.0080.03412.00
5.4.90.0110.03411.99
5.4.80.0030.04112.00
5.4.70.0070.03511.99
5.4.60.0070.03511.99
5.4.50.0070.03511.99
5.4.40.0060.03511.98
5.4.30.0040.03711.98
5.4.20.0060.04111.98
5.4.10.0090.04011.98
5.4.00.0040.04111.47
5.3.290.0050.04212.80
5.3.280.0070.03812.71
5.3.270.0050.04212.72
5.3.260.0070.03912.72
5.3.250.0110.03412.72
5.3.240.0080.03612.72
5.3.230.0050.03912.71
5.3.220.0050.04312.68
5.3.210.0040.04112.68
5.3.200.0050.03812.68
5.3.190.0080.03612.68
5.3.180.0070.03612.68
5.3.170.0080.03512.67
5.3.160.0070.03712.67
5.3.150.0040.04012.68
5.3.140.0080.03512.66
5.3.130.0070.03812.66
5.3.120.0050.04012.66
5.3.110.0050.04812.66
5.3.100.0060.03712.12
5.3.90.0070.03512.09
5.3.80.0070.03612.08
5.3.70.0050.03812.08
5.3.60.0030.04012.07
5.3.50.0140.04212.01
5.3.40.0110.04212.02
5.3.30.0050.03611.97
5.3.20.0090.03211.75
5.3.10.0060.03611.72
5.3.00.0040.03911.71
5.2.170.0030.0329.21
5.2.160.0030.0309.21
5.2.150.0070.0289.21
5.2.140.0040.0349.20
5.2.130.0070.0279.17
5.2.120.0070.0279.16
5.2.110.0060.0299.17
5.2.100.0020.0329.17
5.2.90.0050.0299.17
5.2.80.0040.0329.16
5.2.70.0060.0299.16
5.2.60.0050.0309.13
5.2.50.0060.0299.08
5.2.40.0040.0299.06
5.2.30.0040.0319.04
5.2.20.0050.0299.02
5.2.10.0010.0328.94
5.2.00.0070.0278.80
5.1.60.0090.0208.07
5.1.50.0040.0298.06
5.1.40.0030.0368.05
5.1.30.0060.0318.39
5.1.20.0020.0288.41
5.1.10.0100.0308.14
5.1.00.0050.0268.14
5.0.50.0050.0196.63
5.0.40.0040.0186.48
5.0.30.0030.0316.30
5.0.20.0040.0196.27
5.0.10.0050.0196.25
5.0.00.0060.0296.24
4.4.90.0030.0154.77
4.4.80.0070.0114.75
4.4.70.0050.0144.75
4.4.60.0040.0144.75
4.4.50.0020.0194.77
4.4.40.0050.0284.71
4.4.30.0020.0174.76
4.4.20.0020.0174.84
4.4.10.0020.0184.85
4.4.00.0040.0244.76
4.3.110.0010.0184.67
4.3.100.0050.0134.66
4.3.90.0030.0144.64
4.3.80.0040.0234.58
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0020.0174.63
4.3.40.0040.0234.54
4.3.30.0010.0183.33
4.3.20.0010.0193.30
4.3.10.0020.0193.27
4.3.00.0200.01715.25

preferences:
60.42 ms | 401 KiB | 5 Q