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); $ff = 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) $ff[] = $ff.''.$array2[$j]; } } print_r($ff);

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.00816.36
8.3.50.0090.00722.05
8.3.40.0100.00718.93
8.3.30.0100.00719.21
8.3.20.0040.00420.34
8.3.10.0050.00323.66
8.3.00.0050.00318.02
8.2.180.0130.00716.63
8.2.170.0070.00722.96
8.2.160.0080.00520.41
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00020.73
8.2.110.0080.00020.35
8.2.100.0080.00417.78
8.2.90.0030.00619.40
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0050.00317.93
8.2.50.0060.00318.07
8.2.40.0030.00518.16
8.2.30.0040.00618.36
8.2.20.0050.00317.82
8.2.10.0040.00418.18
8.2.00.0050.00317.73
8.1.280.0090.00625.92
8.1.270.0040.00423.83
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0000.01422.14
8.1.230.0110.00022.10
8.1.220.0000.00917.74
8.1.210.0000.00918.77
8.1.200.0050.00517.35
8.1.190.0030.00517.11
8.1.180.0050.00318.10
8.1.170.0040.00418.65
8.1.160.0040.00421.91
8.1.150.0070.00018.86
8.1.140.0000.00717.49
8.1.130.0000.00717.83
8.1.120.0000.00717.42
8.1.110.0000.00717.33
8.1.100.0040.00417.43
8.1.90.0040.00417.35
8.1.80.0040.00417.53
8.1.70.0040.00417.44
8.1.60.0040.00417.57
8.1.50.0000.00817.54
8.1.40.0000.00817.55
8.1.30.0040.00417.56
8.1.20.0040.00417.64
8.1.10.0040.00417.55
8.1.00.0040.00417.43
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00718.41
8.0.270.0000.00717.32
8.0.260.0000.00617.26
8.0.250.0000.00716.93
8.0.240.0050.00216.92
8.0.230.0000.00816.92
8.0.220.0040.00417.00
8.0.210.0070.00016.89
8.0.200.0000.00717.00
8.0.190.0030.00517.02
8.0.180.0000.00717.03
8.0.170.0000.00816.86
8.0.160.0070.00016.99
8.0.150.0040.00416.83
8.0.140.0030.00616.87
8.0.130.0030.00313.37
8.0.120.0040.00416.92
8.0.110.0000.00716.88
8.0.100.0000.00716.84
8.0.90.0040.00416.83
8.0.80.0060.01017.00
8.0.70.0080.00016.90
8.0.60.0030.00517.02
8.0.50.0040.00417.02
8.0.30.0150.00417.28
8.0.20.0120.00917.40
8.0.10.0040.00417.11
8.0.00.0100.00816.73
7.4.330.0000.00615.00
7.4.320.0030.00316.53
7.4.300.0030.00316.57
7.4.290.0080.00016.40
7.4.280.0000.00716.55
7.4.270.0000.00716.51
7.4.260.0080.00016.63
7.4.250.0040.00416.42
7.4.240.0020.00516.53
7.4.230.0030.00316.32
7.4.220.0000.01716.51
7.4.210.0040.01116.52
7.4.200.0040.00216.71
7.4.160.0090.00916.37
7.4.150.0170.00417.40
7.4.140.0150.00417.86
7.4.130.0110.00716.50
7.4.120.0110.00516.65
7.4.110.0060.01216.71
7.4.100.0030.01416.53
7.4.90.0100.00716.51
7.4.80.0170.00619.39
7.4.70.0160.00416.35
7.4.60.0130.00416.49
7.4.50.0040.00016.43
7.4.40.0100.00616.23
7.4.30.0070.01016.57
7.4.00.0090.00614.93
7.3.330.0000.00613.10
7.3.320.0000.00513.05
7.3.310.0060.00016.33
7.3.300.0070.00016.22
7.3.290.0060.01316.32
7.3.280.0080.01016.31
7.3.270.0120.00617.40
7.3.260.0120.00616.68
7.3.250.0130.00416.48
7.3.240.0080.00816.47
7.3.230.0070.01116.39
7.3.210.0100.00716.48
7.3.200.0100.00619.39
7.3.190.0040.01216.38
7.3.180.0070.01016.41
7.3.170.0120.00316.51
7.3.160.0130.00316.49
7.3.120.0090.00615.02
7.3.10.0110.00816.52
7.3.00.0120.00616.56
7.2.330.0110.00716.62
7.2.320.0120.00616.55
7.2.310.0100.00616.60
7.2.300.0070.01016.46
7.2.290.0130.00316.51
7.2.130.0080.01116.55
7.2.120.0070.00716.34
7.2.110.0070.01016.61
7.2.100.0110.00716.39
7.2.90.0120.00316.51
7.2.80.0150.00616.49
7.2.70.0140.00516.77
7.2.60.0190.00316.69
7.2.50.0160.00416.34
7.2.40.0100.00716.36
7.2.30.0060.00916.73
7.2.20.0080.01616.63
7.2.10.0140.00716.21
7.2.00.0130.00517.96
7.1.250.0070.01015.42
7.1.200.0040.01115.75
7.1.100.0100.00717.88
7.1.70.0060.00617.16
7.1.60.0100.01419.25
7.1.50.0110.01416.69
7.1.00.0030.07722.35
7.0.200.0240.00316.53
7.0.140.0030.06722.04
7.0.60.0100.08319.76
7.0.50.0030.04017.88
7.0.40.0130.06719.96
7.0.30.0300.07320.33
7.0.20.0370.05320.07
7.0.10.0030.09320.23
7.0.00.0030.04020.24
5.6.280.0030.07320.91
5.6.210.0030.04020.47
5.6.200.0100.08018.18
5.6.190.0070.08720.54
5.6.180.0170.04020.51
5.6.170.0400.06320.50
5.6.160.0100.03720.50
5.6.150.0130.06318.18
5.6.140.0100.03718.13
5.6.130.0030.04018.15
5.6.120.0070.08321.14
5.6.110.0100.07321.03
5.6.100.0170.07720.95
5.6.90.0100.08020.97
5.6.80.0030.04720.50
5.5.350.0270.07320.32
5.5.340.0030.07018.08
5.5.330.0070.04320.29
5.5.320.0300.05720.24
5.5.310.0170.04720.34
5.5.300.0100.07718.04
5.5.290.0030.08318.05
5.5.280.0030.08720.64
5.5.270.0070.08320.86
5.5.260.0070.05320.64
5.5.250.0030.08320.68
5.5.240.0000.04020.03
5.4.450.0230.03319.55
5.4.440.0200.03719.27
5.4.430.0100.04719.38
5.4.420.0170.04319.30
5.4.410.0270.03719.28
5.4.400.0230.03018.98
5.4.390.0170.04018.95
5.4.380.0130.04318.85
5.4.370.0200.03319.24
5.4.360.0170.04019.31
5.4.350.0170.03319.00
5.4.340.0200.03319.06
5.4.320.0300.05319.24
5.4.310.0300.04018.99
5.4.300.0230.03319.13
5.4.290.0200.04019.06
5.4.280.0130.06019.13
5.4.270.0300.07019.07
5.4.260.0230.04019.08
5.4.250.0230.04318.98
5.4.240.0370.06319.13
5.4.230.0330.06319.14
5.4.220.0330.06719.21
5.4.210.0370.06719.23
5.4.200.0270.07718.94
5.4.190.0330.07319.08
5.4.180.0370.05019.18
5.4.170.0270.07019.14
5.4.160.0330.07019.24
5.4.150.0330.07019.05
5.4.140.0370.05716.67
5.4.130.0330.07016.50
5.4.120.0270.04716.34
5.4.110.0300.05716.21
5.4.100.0330.06716.53
5.4.90.0330.06316.18
5.4.80.0300.04016.45
5.4.70.0270.04716.52
5.4.60.0300.06316.54
5.4.50.0330.06716.42
5.4.40.0270.07016.51
5.4.30.0230.06016.34
5.4.20.0370.05716.53
5.4.10.0400.05716.42
5.4.00.0300.05715.82
5.3.290.0200.04714.74
5.3.280.0270.07014.51
5.3.270.0270.04714.61
5.3.260.0330.07014.59
5.3.250.0330.06714.50
5.3.240.0300.07014.57
5.3.230.0270.06014.72
5.3.220.0270.07314.67
5.3.210.0300.06014.48
5.3.200.0230.06014.55
5.3.190.0300.05714.64
5.3.180.0330.06314.53
5.3.170.0530.05714.52
5.3.160.0270.06714.64
5.3.150.0300.04314.41
5.3.140.0270.06714.64
5.3.130.0230.04014.46
5.3.120.0170.04314.51
5.3.110.0270.04314.59
5.3.100.0270.07014.02
5.3.90.0300.05714.02
5.3.80.0300.07013.92
5.3.70.0300.03714.01
5.3.60.0230.07314.07
5.3.50.0270.07013.87
5.3.40.0300.05013.99
5.3.30.0270.04313.82
5.3.20.0230.07013.77
5.3.10.0370.06313.56
5.3.00.0270.04013.57
5.2.170.0270.05312.08
5.2.160.0270.03012.08
5.2.150.0170.04012.08
5.2.140.0230.06312.08
5.2.130.0230.06012.08
5.2.120.0200.06012.08
5.2.110.0270.05312.08
5.2.100.0200.03712.08
5.2.90.0270.04712.08
5.2.80.0230.05712.08
5.2.70.0300.05312.08
5.2.60.0300.05012.08
5.2.50.0270.05712.08
5.2.40.0300.05012.08
5.2.30.0200.04012.08
5.2.20.0130.06312.08
5.2.10.0170.04312.08
5.2.00.0170.03712.08
5.1.60.0170.04012.08
5.1.50.0170.03312.08
5.1.40.0130.02712.08
5.1.30.0170.03012.08
5.1.20.0130.03712.08
5.1.10.0130.02712.08
5.1.00.0200.02712.08
5.0.50.0100.04312.08
5.0.40.0100.03012.08
5.0.30.0070.05712.08
5.0.20.0130.03012.08
5.0.10.0070.02712.08
5.0.00.0130.06012.08
4.4.90.0100.03012.08
4.4.80.0100.03712.08
4.4.70.0130.03312.08
4.4.60.0100.03312.08
4.4.50.0100.02712.08
4.4.40.0100.05312.08
4.4.30.0070.02012.08
4.4.20.0100.01312.08
4.4.10.0100.02012.08
4.4.00.0100.05012.08
4.3.110.0170.01312.08
4.3.100.0070.02012.08
4.3.90.0070.02712.08
4.3.80.0100.03312.08
4.3.70.0070.03312.08
4.3.60.0170.01712.08
4.3.50.0100.03712.08
4.3.40.0100.05712.08
4.3.30.0070.02312.08
4.3.20.0070.03312.08
4.3.10.0030.02712.08
4.3.00.0100.03012.08

preferences:
68.76 ms | 401 KiB | 5 Q