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) $temp[] = $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.0120.00616.50
8.3.50.0120.00821.99
8.3.40.0040.01118.65
8.3.30.0070.00719.06
8.3.20.0040.00420.15
8.3.10.0050.00321.68
8.3.00.0040.00417.91
8.2.180.0090.00918.16
8.2.170.0090.01222.96
8.2.160.0070.00720.57
8.2.150.0060.01025.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.04
8.2.110.0030.00620.29
8.2.100.0040.00819.51
8.2.90.0040.00418.92
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0070.00317.79
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0030.00618.35
8.2.20.0040.00417.64
8.2.10.0080.00018.01
8.2.00.0070.00017.79
8.1.280.0110.00725.92
8.1.270.0040.00423.73
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0090.00319.11
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0000.01117.23
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0000.00818.59
8.1.160.0080.00022.00
8.1.150.0000.00718.80
8.1.140.0040.00417.35
8.1.130.0030.00317.45
8.1.120.0040.00417.39
8.1.110.0030.00517.40
8.1.100.0000.00717.44
8.1.90.0040.00417.45
8.1.80.0000.00817.49
8.1.70.0030.00317.43
8.1.60.0080.00017.57
8.1.50.0020.00517.55
8.1.40.0020.00517.46
8.1.30.0000.00817.58
8.1.20.0040.00417.55
8.1.10.0040.00417.39
8.1.00.0030.00517.43
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0030.00318.35
8.0.270.0080.00017.15
8.0.260.0000.00716.73
8.0.250.0070.00016.96
8.0.240.0000.00716.84
8.0.230.0070.00016.87
8.0.220.0090.00016.77
8.0.210.0070.00016.79
8.0.200.0000.00716.98
8.0.190.0000.00716.94
8.0.180.0030.00616.88
8.0.170.0030.00616.81
8.0.160.0040.00416.71
8.0.150.0000.00716.83
8.0.140.0080.00316.86
8.0.130.0030.00313.27
8.0.120.0040.00416.85
8.0.110.0040.00416.83
8.0.100.0050.00216.72
8.0.90.0040.00416.82
8.0.80.0060.00916.92
8.0.70.0040.00416.87
8.0.60.0040.00416.86
8.0.50.0040.00416.91
8.0.30.0080.01317.00
8.0.20.0110.01017.40
8.0.10.0070.00016.80
8.0.00.0090.01216.90
7.4.330.0030.00315.00
7.4.320.0060.00016.54
7.4.300.0070.00016.56
7.4.290.0040.00416.45
7.4.280.0070.00016.64
7.4.270.0080.00016.50
7.4.260.0030.00616.58
7.4.250.0000.00716.57
7.4.240.0050.00216.46
7.4.230.0030.00316.65
7.4.220.0140.00416.56
7.4.210.0120.00316.70
7.4.200.0030.00516.36
7.4.160.0050.01116.26
7.4.150.0060.01217.40
7.4.140.0120.00717.86
7.4.130.0040.01316.59
7.4.120.0080.00816.62
7.4.110.0100.00716.55
7.4.100.0130.01016.45
7.4.90.0140.00416.41
7.4.80.0030.01919.39
7.4.70.0120.00616.49
7.4.60.0120.00616.45
7.4.50.0060.00016.54
7.4.40.0100.00616.68
7.4.30.0060.00916.49
7.4.00.0090.00614.93
7.3.330.0000.00513.03
7.3.320.0000.00513.11
7.3.310.0000.00716.33
7.3.300.0050.00216.27
7.3.290.0060.00716.27
7.3.280.0110.00816.24
7.3.270.0110.00817.40
7.3.260.0090.00916.27
7.3.250.0080.01016.54
7.3.240.0140.00316.53
7.3.230.0140.00316.39
7.3.210.0030.01316.41
7.3.200.0080.00819.39
7.3.190.0140.00716.22
7.3.180.0060.00916.32
7.3.170.0100.00616.50
7.3.160.0100.01116.44
7.3.120.0000.01014.80
7.3.00.0220.00416.66
7.2.330.0120.00916.48
7.2.320.0090.00916.73
7.2.310.0060.00916.66
7.2.300.0000.01716.82
7.2.290.0080.00816.45
7.2.130.0190.00516.73
7.2.120.0100.01016.74
7.2.110.0130.00316.48
7.2.100.0130.00416.74
7.2.90.0140.00316.59
7.2.80.0130.00316.84
7.2.70.0180.00616.93
7.2.60.0170.00316.60
7.2.50.0170.00016.62
7.2.40.0120.01216.65
7.2.30.0130.00616.55
7.2.20.0120.01216.67
7.2.10.0080.00816.80
7.2.00.0040.01018.12
7.1.250.0160.00015.77
7.1.240.0150.00415.78
7.1.230.0140.00315.35
7.1.220.0090.00615.63
7.1.210.0040.01115.57
7.1.200.0080.00515.88
7.1.190.0090.00615.50
7.1.180.0120.00815.34
7.1.170.0090.00615.67
7.1.160.0090.01215.76
7.1.150.0180.00915.59
7.1.140.0080.00615.52
7.1.130.0080.01115.67
7.1.120.0130.00015.70
7.1.110.0070.01015.54
7.1.100.0100.00516.91
7.1.90.0110.00715.77
7.1.80.0090.01515.71
7.1.70.0060.00616.40
7.1.60.0090.00917.56
7.1.50.0120.00816.24
7.1.40.0130.00315.55
7.1.30.0100.01015.71
7.1.20.0180.00315.48
7.1.10.0070.01415.81
7.1.00.0090.03919.00
7.0.330.0080.01214.99
7.0.320.0080.00815.04
7.0.310.0160.00315.13
7.0.300.0090.00914.87
7.0.290.0070.01714.88
7.0.280.0100.01015.04
7.0.270.0180.00615.05
7.0.260.0150.00615.13
7.0.250.0100.00815.48
7.0.240.0100.01015.34
7.0.230.0130.00715.34
7.0.220.0060.00915.33
7.0.210.0100.01015.36
7.0.200.0150.00715.90
7.0.190.0110.01115.54
7.0.180.0130.00615.13
7.0.170.0100.01315.31
7.0.160.0130.00715.30
7.0.150.0090.00415.14
7.0.140.0080.03918.52
7.0.130.0090.00315.17
7.0.120.0070.01115.02
7.0.110.0100.00315.23
7.0.100.0070.01414.98
7.0.90.0030.01315.18
7.0.80.0060.00915.00
7.0.70.0100.00315.27
7.0.60.0060.04917.46
7.0.50.0080.04016.61
7.0.40.0020.03016.84
7.0.30.0180.02516.73
7.0.20.0130.04916.71
7.0.10.0090.02216.60
7.0.00.0080.04316.70
5.6.380.0090.00614.16
5.6.370.0000.01214.20
5.6.360.0120.00714.71
5.6.350.0100.00714.06
5.6.340.0120.00314.34
5.6.330.0030.01214.36
5.6.320.0080.00814.43
5.6.310.0000.01614.34
5.6.300.0100.00614.31
5.6.290.0070.00714.15
5.6.280.0080.03817.55
5.6.270.0090.00614.26
5.6.260.0050.00513.86
5.6.250.0060.00914.41
5.6.240.0080.01214.37
5.6.230.0090.00314.30
5.6.220.0030.00814.26
5.6.210.0080.03217.43
5.6.200.0100.03816.14
5.6.190.0090.02617.29
5.6.180.0270.04317.41
5.6.170.0130.02817.38
5.6.160.0100.03617.58
5.6.150.0050.04216.21
5.6.140.0050.04516.23
5.6.130.0070.02216.23
5.6.120.0070.03217.45
5.6.110.0100.03117.66
5.6.100.0060.04817.43
5.6.90.0070.04517.76
5.6.80.0060.04617.33
5.6.70.0110.00414.05
5.6.60.0130.00314.27
5.6.50.0030.01214.10
5.6.40.0100.00313.93
5.6.30.0000.01314.30
5.6.20.0000.01414.28
5.6.10.0110.00414.22
5.6.00.0000.01214.38
5.5.380.0080.00511.18
5.5.370.0020.00511.18
5.5.360.0030.01011.18
5.5.350.0130.04215.81
5.5.340.0110.03514.58
5.5.330.0080.01815.87
5.5.320.0170.03015.76
5.5.310.0180.03915.71
5.5.300.0020.03514.56
5.5.290.0010.04114.62
5.5.280.0010.04315.97
5.5.270.0070.04216.01
5.5.260.0050.04315.97
5.5.250.0100.01816.05
5.5.240.0050.04315.77
5.5.230.0040.00411.18
5.5.220.0030.00311.18
5.5.210.0000.01211.18
5.5.200.0060.00611.33
5.5.190.0040.00711.18
5.5.180.0040.00811.18
5.5.170.0080.00311.18
5.5.160.0030.00911.18
5.5.150.0040.00711.18
5.5.140.0070.00411.18
5.5.130.0100.00011.18
5.5.120.0130.00011.18
5.5.110.0110.00011.18
5.5.100.0000.00711.18
5.5.90.0030.00611.18
5.5.80.0030.00611.18
5.5.70.0030.00611.18
5.5.60.0060.00711.18
5.5.50.0110.00011.18
5.5.40.0070.00411.18
5.5.30.0060.00611.18
5.5.20.0090.00011.18
5.5.10.0070.00311.18
5.5.00.0070.00011.18
5.4.450.0050.03815.43
5.4.440.0170.03115.35
5.4.430.0440.03415.40
5.4.420.0420.03515.33
5.4.410.0080.03114.93
5.4.400.0200.03314.86
5.4.390.0270.03614.96
5.4.380.0100.03115.01
5.4.370.0110.01914.92
5.4.360.0050.02314.82
5.4.350.0070.02011.59
5.4.340.0070.01911.59
5.4.330.0030.00311.18
5.4.320.0070.02211.83
5.4.310.0090.02911.83
5.4.300.0090.02711.83
5.4.290.0090.02711.93
5.4.280.0070.02811.78
5.4.270.0100.02311.78
5.4.260.0060.02311.78
5.4.250.0060.02011.78
5.4.240.0100.01911.82
5.4.230.0030.02411.77
5.4.220.0060.02011.77
5.4.210.0060.01911.80
5.4.200.0070.02111.77
5.4.190.0040.02311.80
5.4.180.0030.02511.84
5.4.170.0070.02611.78
5.4.160.0060.02011.77
5.4.150.0020.02311.77
5.4.140.0070.02211.64
5.4.130.0050.01911.61
5.4.120.0060.02011.59
5.4.110.0070.01911.64
5.4.100.0050.02111.58
5.4.90.0050.02111.58
5.4.80.0050.02111.58
5.4.70.0040.02111.65
5.4.60.0100.01611.58
5.4.50.0080.02011.65
5.4.40.0040.02211.58
5.4.30.0040.02211.58
5.4.20.0080.01811.66
5.4.10.0090.01611.60
5.4.00.0070.02111.32
5.3.290.0060.02311.99
5.3.280.0040.02311.94
5.3.270.0040.02311.95
5.3.260.0060.02211.95
5.3.250.0080.01911.95
5.3.240.0050.02211.95
5.3.230.0050.02211.94
5.3.220.0040.02011.93
5.3.210.0080.02111.93
5.3.200.0040.02311.93
5.3.190.0060.02111.93
5.3.180.0040.02311.93
5.3.170.0070.01911.92
5.3.160.0040.02311.93
5.3.150.0050.02211.92
5.3.140.0050.02111.92
5.3.130.0050.02111.92
5.3.120.0060.02211.91
5.3.110.0060.02111.92
5.3.100.0050.01911.65
5.3.90.0040.02311.63
5.3.80.0080.01511.63
5.3.70.0060.01911.63
5.3.60.0050.02111.62
5.3.50.0070.01911.60
5.3.40.0070.02011.59
5.3.30.0040.01911.58
5.3.20.0030.02011.47
5.3.10.0100.01811.45
5.3.00.0100.01811.44
5.2.170.0060.01410.19
5.2.160.0050.01710.19
5.2.150.0060.01810.19
5.2.140.0020.02010.19
5.2.130.0050.01510.17
5.2.120.0050.01810.17
5.2.110.0090.01510.17
5.2.100.0060.01710.17
5.2.90.0060.01510.17
5.2.80.0040.01610.17
5.2.70.0060.01610.17
5.2.60.0050.01810.15
5.2.50.0070.01410.13
5.2.40.0060.01710.12
5.2.30.0040.02010.11
5.2.20.0060.01410.10
5.2.10.0020.02010.06
5.2.00.0080.0209.99
5.1.60.0050.0189.62
5.1.50.0020.0179.62
5.1.40.0020.0159.61
5.1.30.0060.0149.78
5.1.20.0040.0169.80
5.1.10.0040.0169.66
5.1.00.0050.0139.66
5.0.50.0020.0148.90
5.0.40.0040.0128.83
5.0.30.0020.0198.74
5.0.20.0090.0118.72
5.0.10.0020.0138.71
5.0.00.0040.0208.71
4.4.90.0020.0127.98
4.4.80.0020.0117.97
4.4.70.0040.0077.97
4.4.60.0020.0107.97
4.4.50.0050.0077.97
4.4.40.0030.0147.94
4.4.30.0030.0097.96
4.4.20.0040.0078.01
4.4.10.0030.0088.01
4.4.00.0030.0147.97
4.3.110.0040.0127.92
4.3.100.0040.0117.92
4.3.90.0020.0127.90
4.3.80.0030.0187.88
4.3.70.0020.0137.90
4.3.60.0030.0117.90
4.3.50.0020.0127.90
4.3.40.0020.0147.86
4.3.30.0040.0107.25
4.3.20.0030.0117.24
4.3.10.0020.0107.22
4.3.00.0030.0109.10

preferences:
40.23 ms | 401 KiB | 5 Q