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++) { $ff=''; //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.0080.00618.43
8.3.50.0080.00822.18
8.3.40.0070.01018.57
8.3.30.0070.00719.20
8.3.20.0040.00420.17
8.3.10.0080.00023.44
8.3.00.0060.01319.68
8.2.180.0060.01016.38
8.2.170.0110.00422.96
8.2.160.0100.00320.11
8.2.150.0030.00524.18
8.2.140.0090.00024.66
8.2.130.0050.00226.16
8.2.120.0080.00020.97
8.2.110.0000.01021.11
8.2.100.0080.00417.78
8.2.90.0060.00317.72
8.2.80.0030.00617.97
8.2.70.0080.00017.63
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0090.00019.82
8.2.30.0030.00818.32
8.2.20.0000.00817.63
8.2.10.0040.00418.18
8.2.00.0030.00517.74
8.1.280.0030.01425.92
8.1.270.0090.00323.99
8.1.260.0030.00626.35
8.1.250.0070.00028.09
8.1.240.0000.00922.61
8.1.230.0040.00720.98
8.1.220.0030.00517.74
8.1.210.0090.00018.95
8.1.200.0200.00217.10
8.1.190.0030.00517.22
8.1.180.0050.00318.10
8.1.170.0000.01018.64
8.1.160.0000.00721.98
8.1.150.0080.00018.78
8.1.140.0040.00417.45
8.1.130.0040.00417.86
8.1.120.0000.00717.50
8.1.110.0030.00317.44
8.1.100.0040.00417.46
8.1.90.0000.00717.36
8.1.80.0030.00317.51
8.1.70.0000.00817.46
8.1.60.0040.00417.64
8.1.50.0030.00617.52
8.1.40.0000.00817.57
8.1.30.0040.00417.71
8.1.20.0040.00417.66
8.1.10.0040.00417.55
8.1.00.0040.00417.57
8.0.300.0000.00720.04
8.0.290.0000.00816.75
8.0.280.0030.00318.45
8.0.270.0070.00017.17
8.0.260.0000.00617.20
8.0.250.0050.00216.89
8.0.240.0050.00316.91
8.0.230.0040.00416.97
8.0.220.0030.00616.92
8.0.210.0000.00816.93
8.0.200.0050.00216.96
8.0.190.0030.00517.02
8.0.180.0000.00816.98
8.0.170.0040.00416.81
8.0.160.0000.00716.96
8.0.150.0070.00016.73
8.0.140.0000.00816.88
8.0.130.0030.00313.32
8.0.120.0000.00816.86
8.0.110.0040.00416.88
8.0.100.0050.00216.93
8.0.90.0040.00416.90
8.0.80.0090.00616.87
8.0.70.0040.00416.96
8.0.60.0050.00216.71
8.0.50.0040.00416.94
8.0.30.0110.00716.94
8.0.20.0190.00217.40
8.0.10.0030.00516.88
8.0.00.0090.00816.75
7.4.330.0050.00015.00
7.4.320.0030.00316.58
7.4.300.0000.00616.56
7.4.290.0000.00716.52
7.4.280.0070.00016.46
7.4.270.0070.00016.50
7.4.260.0000.00716.60
7.4.250.0040.00416.45
7.4.240.0040.00416.61
7.4.230.0000.00716.39
7.4.220.0060.00916.67
7.4.210.0040.01116.61
7.4.200.0070.00016.61
7.4.160.0090.00916.55
7.4.150.0130.00617.40
7.4.140.0120.00517.86
7.4.130.0110.00816.41
7.4.120.0100.00716.53
7.4.110.0130.00816.54
7.4.100.0090.00916.45
7.4.90.0100.00716.32
7.4.80.0070.01519.39
7.4.70.0090.00616.43
7.4.60.0030.01316.66
7.4.50.0050.00016.33
7.4.40.0080.00816.48
7.4.30.0130.00316.56
7.4.00.0040.01114.97
7.3.330.0060.00013.14
7.3.320.0060.00012.98
7.3.310.0030.00316.14
7.3.300.0070.00016.25
7.3.290.0070.00716.29
7.3.280.0100.01016.27
7.3.270.0150.00217.40
7.3.260.0110.00516.18
7.3.250.0080.01016.55
7.3.240.0100.01316.38
7.3.230.0160.00716.50
7.3.210.0120.00616.34
7.3.200.0130.00319.39
7.3.190.0100.01016.38
7.3.180.0100.00716.25
7.3.170.0060.00916.40
7.3.160.0090.01216.43
7.3.120.0070.00714.91
7.2.330.0030.01416.55
7.2.320.0070.01416.72
7.2.310.0110.01116.63
7.2.300.0100.00716.48
7.2.290.0030.01316.61
7.2.60.0190.00016.97
7.2.00.0070.00719.59
7.1.200.0100.00015.61
7.1.100.0070.00717.87
7.1.70.0030.00617.04
7.1.60.0070.01719.25
7.1.50.0110.01417.02
7.1.00.0100.07022.45
7.0.200.0210.01116.39
7.0.140.0070.06722.15
7.0.60.0070.06320.00
7.0.50.0030.08317.86
7.0.40.0100.04020.26
7.0.30.0400.07320.24
7.0.20.0330.05720.06
7.0.10.0030.05020.17
7.0.00.0070.05320.09
5.6.280.0000.07321.12
5.6.210.0100.08020.71
5.6.200.0030.05718.19
5.6.190.0070.08720.47
5.6.180.0200.04320.64
5.6.170.0200.03720.47
5.6.160.0070.08320.47
5.6.150.0070.05318.15
5.6.140.0070.06718.18
5.6.130.0030.04018.14
5.6.120.0100.08021.13
5.6.110.0100.08320.97
5.6.100.0030.06020.88
5.6.90.0100.07720.95
5.6.80.0100.07320.52
5.5.350.0230.08020.41
5.5.340.0070.08018.09
5.5.330.0100.08320.42
5.5.320.0230.04020.30
5.5.310.0230.04720.24
5.5.300.0030.06317.95
5.5.290.0030.04317.95
5.5.280.0070.08320.82
5.5.270.0030.08320.64
5.5.260.0130.07320.72
5.5.250.0130.07320.76
5.5.240.0070.07720.23
5.4.450.0670.06719.48
5.4.440.0530.05719.33
5.4.430.0670.06319.57
5.4.420.0900.05719.58
5.4.410.0000.06318.95
5.4.400.0530.04718.80
5.4.390.0300.05318.50
5.4.380.0230.05318.80
5.4.370.0070.05318.62
5.4.360.0170.03718.75
5.4.350.0070.04912.00
5.4.340.0070.04412.00
5.4.320.0090.04212.48
5.4.310.0050.04012.48
5.4.300.0040.04012.48
5.4.290.0070.03712.48
5.4.280.0070.03512.38
5.4.270.0070.03612.38
5.4.260.0060.03812.38
5.4.250.0100.03412.38
5.4.240.0090.03412.38
5.4.230.0040.04012.37
5.4.220.0070.03512.37
5.4.210.0060.03512.37
5.4.200.0060.03712.37
5.4.190.0100.03212.37
5.4.180.0040.03812.37
5.4.170.0040.03912.38
5.4.160.0070.03412.37
5.4.150.0060.03612.37
5.4.140.0040.03912.05
5.4.130.0050.03612.04
5.4.120.0050.04112.00
5.4.110.0090.03311.99
5.4.100.0060.03511.99
5.4.90.0070.05112.00
5.4.80.0110.04612.00
5.4.70.0100.03111.99
5.4.60.0080.03311.99
5.4.50.0060.03911.99
5.4.40.0060.03411.98
5.4.30.0080.03611.98
5.4.20.0100.04711.98
5.4.10.0080.04611.98
5.4.00.0080.04811.47
5.3.290.0080.04512.80
5.3.280.0080.05012.71
5.3.270.0090.03812.72
5.3.260.0050.04012.72
5.3.250.0040.03912.72
5.3.240.0060.03912.71
5.3.230.0070.03712.71
5.3.220.0040.04012.68
5.3.210.0050.04012.68
5.3.200.0090.05012.68
5.3.190.0120.04412.68
5.3.180.0090.04612.67
5.3.170.0050.03712.67
5.3.160.0080.03612.67
5.3.150.0030.04012.67
5.3.140.0040.03812.66
5.3.130.0060.03912.66
5.3.120.0030.04112.66
5.3.110.0060.03812.66
5.3.100.0050.03712.12
5.3.90.0080.03512.09
5.3.80.0070.03512.08
5.3.70.0060.03612.08
5.3.60.0090.04212.06
5.3.50.0050.04012.02
5.3.40.0050.03912.01
5.3.30.0100.03211.97
5.3.20.0060.03511.75
5.3.10.0060.03511.71
5.3.00.0050.03711.71
5.2.170.0050.0359.21
5.2.160.0040.0309.21
5.2.150.0040.0349.21
5.2.140.0070.0339.20
5.2.130.0070.0369.16
5.2.120.0050.0399.16
5.2.110.0060.0329.18
5.2.100.0020.0329.17
5.2.90.0080.0279.17
5.2.80.0020.0359.16
5.2.70.0080.0299.16
5.2.60.0070.0299.11
5.2.50.0040.0329.09
5.2.40.0060.0309.06
5.2.30.0090.0419.04
5.2.20.0100.0369.03
5.2.10.0090.0488.94
5.2.00.0060.0378.80
5.1.60.0040.0298.07
5.1.50.0050.0268.06
5.1.40.0060.0268.04
5.1.30.0080.0278.39
5.1.20.0050.0308.41
5.1.10.0030.0308.14
5.1.00.0090.0248.14
5.0.50.0030.0246.63
5.0.40.0030.0226.49
5.0.30.0060.0316.30
5.0.20.0020.0236.27
5.0.10.0020.0226.25
5.0.00.0040.0326.24
4.4.90.0050.0164.78
4.4.80.0050.0154.76
4.4.70.0040.0164.75
4.4.60.0010.0184.75
4.4.50.0030.0164.77
4.4.40.0040.0264.71
4.4.30.0050.0174.76
4.4.20.0030.0214.84
4.4.10.0060.0204.85
4.4.00.0040.0314.76
4.3.110.0030.0224.67
4.3.100.0050.0194.66
4.3.90.0050.0194.63
4.3.80.0040.0304.59
4.3.70.0020.0224.63
4.3.60.0030.0214.63
4.3.50.0060.0194.63
4.3.40.0050.0294.54
4.3.30.0030.0213.33
4.3.20.0030.0203.30
4.3.10.0010.0223.27
4.3.00.0130.0237.21

preferences:
41.35 ms | 401 KiB | 5 Q