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[] = $words[$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.0110.00716.38
8.3.50.0100.01018.18
8.3.40.0120.00318.78
8.3.30.0110.00419.00
8.3.20.0070.00020.20
8.3.10.0050.00321.85
8.3.00.0080.00017.80
8.2.180.0090.00616.88
8.2.170.0070.00722.96
8.2.160.0070.00720.36
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00419.81
8.2.110.0090.00020.54
8.2.100.0040.00817.78
8.2.90.0000.00819.05
8.2.80.0030.00517.97
8.2.70.0030.00517.75
8.2.60.0000.00818.05
8.2.50.0050.00518.07
8.2.40.0030.00618.16
8.2.30.0070.00318.25
8.2.20.0090.00017.78
8.2.10.0080.00018.17
8.2.00.0060.00317.82
8.1.280.0100.00725.92
8.1.270.0060.00323.97
8.1.260.0000.00726.35
8.1.250.0020.00528.09
8.1.240.0190.00322.05
8.1.230.0000.01122.15
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0060.00317.23
8.1.180.0090.00018.10
8.1.170.0070.00318.68
8.1.160.0040.00421.92
8.1.150.0000.00818.75
8.1.140.0000.00717.45
8.1.130.0000.00717.76
8.1.120.0070.00017.41
8.1.110.0000.00817.32
8.1.100.0000.00717.36
8.1.90.0050.00317.38
8.1.80.0030.00517.46
8.1.70.0000.00717.38
8.1.60.0040.00417.62
8.1.50.0040.00417.48
8.1.40.0000.00817.49
8.1.30.0000.00817.53
8.1.20.0000.00817.55
8.1.10.0000.00817.45
8.1.00.0040.00417.53
8.0.300.0070.00018.77
8.0.290.0000.00716.58
8.0.280.0030.00318.38
8.0.270.0030.00317.21
8.0.260.0000.00617.22
8.0.250.0000.00716.85
8.0.240.0070.00016.99
8.0.230.0030.00316.81
8.0.220.0000.00716.84
8.0.210.0030.00316.77
8.0.200.0060.00016.92
8.0.190.0040.00416.96
8.0.180.0040.00416.88
8.0.170.0030.00516.92
8.0.160.0040.00416.82
8.0.150.0000.00716.91
8.0.140.0030.00716.81
8.0.130.0000.00513.48
8.0.120.0070.00016.93
8.0.110.0000.00716.87
8.0.100.0050.00316.99
8.0.90.0070.00016.73
8.0.80.0040.01116.99
8.0.70.0000.00716.75
8.0.60.0080.00016.83
8.0.50.0030.00516.81
8.0.30.0120.00717.06
8.0.20.0100.00817.40
8.0.10.0040.00417.05
8.0.00.0130.00616.67
7.4.330.0000.00515.16
7.4.320.0030.00316.61
7.4.300.0040.00416.59
7.4.290.0000.00816.36
7.4.280.0080.00016.50
7.4.270.0030.00316.62
7.4.260.0000.00716.39
7.4.250.0040.00416.46
7.4.240.0030.00416.51
7.4.230.0030.00316.45
7.4.220.0100.01616.50
7.4.210.0070.00716.61
7.4.200.0040.00416.48
7.4.160.0090.00616.57
7.4.150.0230.00017.40
7.4.140.0060.01217.86
7.4.130.0090.00916.46
7.4.120.0090.01116.55
7.4.110.0040.01316.58
7.4.100.0120.00816.37
7.4.90.0110.00816.52
7.4.80.0090.01319.39
7.4.70.0070.01016.69
7.4.60.0120.00616.58
7.4.50.0090.00016.27
7.4.40.0130.00416.71
7.4.30.0040.01216.48
7.4.10.0080.00814.94
7.4.00.0050.00914.96
7.3.330.0030.00313.07
7.3.320.0030.00313.21
7.3.310.0060.00016.42
7.3.300.0000.00716.35
7.3.290.0030.01016.36
7.3.280.0080.01116.35
7.3.270.0040.01517.40
7.3.260.0110.00816.61
7.3.250.0090.00816.40
7.3.240.0090.00916.45
7.3.230.0100.00616.53
7.3.210.0150.00416.55
7.3.200.0030.01319.39
7.3.190.0080.01116.55
7.3.180.0040.01216.37
7.3.170.0040.01216.45
7.3.160.0050.01516.52
7.3.130.0040.01514.61
7.3.120.0020.01514.81
7.3.110.0100.01014.93
7.3.100.0120.00314.89
7.3.90.0090.00014.84
7.3.80.0070.01114.94
7.3.70.0040.01114.98
7.3.60.0040.00814.63
7.3.50.0040.01214.63
7.3.40.0040.00414.86
7.3.30.0070.00714.82
7.3.20.0070.00716.63
7.3.10.0090.00316.58
7.3.00.0030.01416.72
7.2.330.0120.00616.38
7.2.320.0150.00716.34
7.2.310.0090.01316.66
7.2.300.0130.00516.65
7.2.290.0090.00616.48
7.2.260.0060.01215.27
7.2.250.0040.01114.95
7.2.240.0030.01015.02
7.2.230.0090.00614.99
7.2.220.0060.01314.96
7.2.210.0030.01014.91
7.2.200.0000.00915.20
7.2.190.0000.01514.87
7.2.180.0060.01214.85
7.2.170.0040.00814.98
7.2.160.0060.00914.84
7.2.150.0110.00716.98
7.2.140.0000.01516.99
7.2.130.0040.01416.68
7.2.120.0000.01416.89
7.2.110.0030.00816.55
7.2.100.0090.00616.74
7.2.90.0120.00616.75
7.2.80.0060.00917.05
7.2.70.0100.01016.71
7.2.60.0140.00416.80
7.2.50.0070.01117.13
7.2.40.0090.00616.91
7.2.30.0070.01117.02
7.2.20.0060.00917.05
7.2.10.0070.00716.77
7.2.00.0050.00818.19
7.1.330.0030.00515.76
7.1.320.0130.00615.60
7.1.310.0130.00315.80
7.1.300.0070.01115.74
7.1.290.0060.00615.93
7.1.280.0100.00315.86
7.1.270.0070.00715.57
7.1.260.0070.01015.84
7.1.250.0030.00615.75
7.1.240.0060.00615.71
7.1.230.0000.01615.95
7.1.220.0060.00915.93
7.1.210.0070.01015.66
7.1.200.0060.00715.84
7.1.190.0000.01515.58
7.1.180.0070.00715.68
7.1.170.0030.00915.64
7.1.160.0090.00615.96
7.1.150.0030.00615.77
7.1.140.0030.01015.93
7.1.130.0070.00715.89
7.1.120.0060.00615.80
7.1.110.0000.01316.00
7.1.100.0050.00816.81
7.1.90.0070.00715.84
7.1.80.0100.00315.90
7.1.70.0020.00816.38
7.1.60.0040.01217.51
7.1.50.0060.01116.33
7.1.40.0040.00715.60
7.1.30.0060.00615.98
7.1.20.0060.00315.61
7.1.10.0100.00315.59
7.1.00.0060.04119.03
7.0.330.0000.01215.54
7.0.320.0040.01515.34
7.0.310.0050.00315.37
7.0.300.0000.00815.44
7.0.290.0030.00715.34
7.0.280.0050.00515.58
7.0.270.0040.01115.50
7.0.260.0080.00415.55
7.0.250.0140.00015.47
7.0.240.0030.00515.56
7.0.230.0040.01115.34
7.0.220.0060.00615.50
7.0.210.0000.00915.32
7.0.200.0100.01015.99
7.0.190.0060.01015.43
7.0.180.0030.01015.39
7.0.170.0060.00315.45
7.0.160.0000.01415.26
7.0.150.0030.01015.50
7.0.140.0030.04118.82
7.0.130.0000.00815.55
7.0.120.0090.00315.44
7.0.110.0030.00715.50
7.0.100.0040.00415.34
7.0.90.0060.01015.33
7.0.80.0070.01115.53
7.0.70.0040.00815.48
7.0.60.0140.02517.79
7.0.50.0050.02316.65
7.0.40.0150.02016.79
7.0.30.0220.04116.81
7.0.20.0220.03516.82
7.0.10.0070.04616.93
7.0.00.0070.04416.87
5.6.400.0070.01114.32
5.6.390.0000.01414.69
5.6.380.0030.01314.47
5.6.370.0000.01514.62
5.6.360.0000.01414.38
5.6.350.0060.00614.51
5.6.340.0070.00714.19
5.6.330.0030.01014.04
5.6.320.0090.00614.25
5.6.310.0070.00714.64
5.6.300.0030.01014.20
5.6.290.0090.00614.29
5.6.280.0040.04117.53
5.6.270.0070.00714.43
5.6.260.0070.01114.39
5.6.250.0030.01014.35
5.6.240.0130.00314.40
5.6.230.0040.01614.45
5.6.220.0050.00814.44
5.6.210.0050.04417.58
5.6.200.0050.03016.32
5.6.190.0070.04217.46
5.6.180.0150.04817.58
5.6.170.0110.02517.40
5.6.160.0100.03517.58
5.6.150.0050.02716.25
5.6.140.0070.04216.35
5.6.130.0040.02416.30
5.6.120.0110.03817.72
5.6.110.0080.04517.80
5.6.100.0050.03817.78
5.6.90.0070.04917.73
5.6.80.0080.02617.35
5.6.70.0050.00814.13
5.6.60.0090.00314.12
5.6.50.0070.01014.34
5.6.40.0160.00014.50
5.6.30.0100.00614.05
5.6.20.0080.00314.16
5.6.10.0090.00614.62
5.6.00.0040.01114.26
5.5.380.0090.00914.50
5.5.370.0070.01014.43
5.5.360.0120.00614.13
5.5.350.0180.04317.28
5.5.340.0110.03716.04
5.5.330.0090.03917.27
5.5.320.0050.03217.31
5.5.310.0170.02517.18
5.5.300.0060.03616.21
5.5.290.0100.04016.30
5.5.280.0050.04817.59
5.5.270.0080.04317.50
5.5.260.0030.04017.59
5.5.250.0050.04017.44
5.5.240.0060.04017.14
5.5.230.0030.01213.97
5.5.220.0070.01014.36
5.5.210.0050.00514.25
5.5.200.0090.00614.11
5.5.190.0100.00314.53
5.5.180.0040.01114.50
5.5.170.0070.00714.19
5.5.160.0070.00414.37
5.5.150.0040.01114.48
5.5.140.0030.01314.02
5.5.130.0060.00914.15
5.5.120.0040.01414.37
5.5.110.0070.01014.13
5.5.100.0030.01014.06
5.5.90.0070.00714.58
5.5.80.0070.00714.45
5.5.70.0030.01014.11
5.5.60.0130.00314.16
5.5.50.0070.00714.41
5.5.40.0030.01214.21
5.5.30.0130.00314.52
5.5.20.0060.00814.27
5.5.10.0070.00614.08
5.5.00.0110.00414.22
5.4.450.0360.03615.41
5.4.440.0530.03415.28
5.4.430.0050.03215.09
5.4.420.0380.04215.26
5.4.410.0110.02615.12
5.4.400.0200.02814.92
5.4.390.0180.03714.80
5.4.380.0100.03314.86
5.4.370.0050.02814.90
5.4.360.0080.02914.91
5.4.350.0080.01911.57
5.4.340.0090.01911.60
5.4.330.0030.00911.05
5.4.320.0010.02711.82
5.4.310.0070.02011.65
5.4.300.0030.02511.85
5.4.290.0100.01911.79
5.4.280.0090.02211.83
5.4.270.0070.02011.70
5.4.260.0070.02111.79
5.4.250.0050.02111.71
5.4.240.0090.01811.73
5.4.230.0040.02611.73
5.4.220.0060.02211.76
5.4.210.0020.02311.71
5.4.200.0050.02311.61
5.4.190.0060.02211.59
5.4.180.0050.02111.52
5.4.170.0040.02511.63
5.4.160.0030.02911.65
5.4.150.0050.02111.53
5.4.140.0030.02311.50
5.4.130.0040.02311.56
5.4.120.0060.02011.57
5.4.110.0070.02011.39
5.4.100.0110.01711.62
5.4.90.0020.02411.52
5.4.80.0050.02311.64
5.4.70.0020.02511.60
5.4.60.0050.02111.63
5.4.50.0040.02211.60
5.4.40.0070.02211.56
5.4.30.0060.02011.60
5.4.20.0020.02511.46
5.4.10.0090.01711.44
5.4.00.0030.02511.26
5.3.290.0040.02511.68
5.3.280.0060.02011.67
5.3.270.0060.02211.72
5.3.260.0060.02311.72
5.3.250.0060.02411.69
5.3.240.0060.02211.57
5.3.230.0050.02511.67
5.3.220.0040.02411.67
5.3.210.0040.02111.59
5.3.200.0080.01911.62
5.3.190.0050.02311.58
5.3.180.0060.02611.76
5.3.170.0070.02111.67
5.3.160.0060.02311.74
5.3.150.0030.02311.76
5.3.140.0070.02111.54
5.3.130.0070.02311.71
5.3.120.0060.02411.70
5.3.110.0050.02311.61
5.3.100.0060.02211.41
5.3.90.0060.01911.29
5.3.80.0060.02111.16
5.3.70.0060.02211.31
5.3.60.0040.02111.14
5.3.50.0040.02411.30
5.3.40.0070.02111.18
5.3.30.0090.01911.30
5.3.20.0040.02411.07
5.3.10.0040.02411.08
5.3.00.0050.02111.00
5.2.170.0030.0319.21
5.2.160.0060.0279.21
5.2.150.0060.0299.21
5.2.140.0060.0329.21
5.2.130.0060.0289.16
5.2.120.0050.0309.16
5.2.110.0060.0289.17
5.2.100.0030.0309.17
5.2.90.0030.0329.17
5.2.80.0070.0289.16
5.2.70.0070.0289.16
5.2.60.0080.0389.11
5.2.50.0040.0319.09
5.2.40.0030.0309.06
5.2.30.0080.0339.04
5.2.20.0010.0329.02
5.2.10.0050.0278.93
5.2.00.0060.0288.80
5.1.60.0020.0268.07
5.1.50.0020.0268.07
5.1.40.0020.0268.04
5.1.30.0040.0258.39
5.1.20.0030.0278.41
5.1.10.0080.0258.14
5.1.00.0030.0268.14
5.0.50.0050.0256.62
5.0.40.0050.0186.48
5.0.30.0030.0316.29
5.0.20.0020.0206.26
5.0.10.0050.0186.24
5.0.00.0020.0316.23
4.4.90.0030.0154.78
4.4.80.0030.0154.75
4.4.70.0030.0164.75
4.4.60.0040.0144.75
4.4.50.0020.0164.77
4.4.40.0050.0224.71
4.4.30.0020.0164.76
4.4.20.0020.0164.84
4.4.10.0030.0154.85
4.4.00.0040.0234.76
4.3.110.0040.0144.67
4.3.100.0050.0124.67
4.3.90.0020.0164.64
4.3.80.0040.0234.59
4.3.70.0010.0164.63
4.3.60.0010.0164.63
4.3.50.0020.0174.62
4.3.40.0000.0264.53
4.3.30.0040.0153.32
4.3.20.0030.0153.29
4.3.10.0020.0163.26
4.3.00.0100.0237.21

preferences:
59.25 ms | 400 KiB | 5 Q