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++) { $ff=''; //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]; } if(!empty($ff)) $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.0070.00718.09
8.3.50.0120.00422.05
8.3.40.0070.00718.70
8.3.30.0070.01019.21
8.3.20.0040.00420.23
8.3.10.0000.00821.62
8.3.00.0050.00319.68
8.2.180.0100.00716.38
8.2.170.0110.00322.96
8.2.160.0070.00720.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0040.00419.95
8.2.110.0190.00321.10
8.2.100.0000.01117.78
8.2.90.0090.00019.26
8.2.80.0030.00617.97
8.2.70.0080.00017.72
8.2.60.0070.00317.93
8.2.50.0040.00418.07
8.2.40.0030.00620.07
8.2.30.0050.00518.19
8.2.20.0020.00517.74
8.2.10.0000.00718.08
8.2.00.0030.00617.75
8.1.280.0100.00725.92
8.1.270.0060.00323.84
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0000.00821.47
8.1.230.0030.00917.42
8.1.220.0030.00717.78
8.1.210.0030.00518.77
8.1.200.0080.00317.22
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0100.00018.64
8.1.160.0040.00421.91
8.1.150.0050.00218.95
8.1.140.0000.00817.39
8.1.130.0040.00417.84
8.1.120.0000.00717.49
8.1.110.0070.00017.48
8.1.100.0080.00017.36
8.1.90.0030.00417.37
8.1.80.0030.00517.41
8.1.70.0000.00817.34
8.1.60.0000.00717.49
8.1.50.0060.00317.49
8.1.40.0040.00417.54
8.1.30.0000.00817.57
8.1.20.0080.00017.70
8.1.10.0000.00817.48
8.1.00.0040.00417.51
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00218.46
8.0.270.0040.00416.82
8.0.260.0000.00817.18
8.0.250.0000.00716.97
8.0.240.0000.00716.84
8.0.230.0000.00816.95
8.0.220.0040.00416.87
8.0.210.0000.00716.91
8.0.200.0000.00616.93
8.0.190.0000.00716.94
8.0.180.0050.00216.90
8.0.170.0080.00016.97
8.0.160.0000.00716.84
8.0.150.0040.00416.86
8.0.140.0030.00616.84
8.0.130.0060.00013.36
8.0.120.0000.00816.86
8.0.110.0030.00616.80
8.0.100.0040.00416.71
8.0.90.0030.00316.77
8.0.80.0100.00616.84
8.0.70.0070.00016.96
8.0.60.0030.00316.75
8.0.50.0080.00016.93
8.0.30.0100.00817.31
8.0.20.0080.01117.40
8.0.10.0090.00016.90
8.0.00.0090.01116.70
7.4.330.0060.00015.08
7.4.320.0000.00616.63
7.4.300.0030.00316.50
7.4.290.0000.00816.49
7.4.280.0090.00016.46
7.4.270.0040.00416.57
7.4.260.0040.00416.59
7.4.250.0000.00716.45
7.4.240.0020.00516.55
7.4.230.0000.00716.70
7.4.220.0110.00616.42
7.4.210.0080.00616.58
7.4.200.0000.00716.34
7.4.160.0100.00616.45
7.4.150.0100.00717.40
7.4.140.0090.00917.86
7.4.130.0130.00516.58
7.4.120.0100.00916.42
7.4.110.0090.00916.77
7.4.100.0120.01216.39
7.4.90.0030.01316.43
7.4.80.0170.00719.39
7.4.70.0100.00716.51
7.4.60.0080.00816.44
7.4.50.0040.00016.62
7.4.40.0120.00316.57
7.4.30.0090.00616.61
7.4.10.0100.01016.02
7.4.00.0070.00915.31
7.3.330.0030.00313.20
7.3.320.0000.00613.17
7.3.310.0030.00316.16
7.3.300.0030.00316.26
7.3.290.0060.00916.44
7.3.280.0110.00716.28
7.3.270.0120.00617.40
7.3.260.0090.01216.50
7.3.250.0120.00516.36
7.3.240.0140.00316.38
7.3.230.0100.00716.39
7.3.210.0100.00716.49
7.3.200.0090.01119.39
7.3.190.0030.01316.46
7.3.180.0070.00716.30
7.3.170.0060.00916.36
7.3.160.0170.00316.48
7.3.130.0000.01816.27
7.3.120.0060.00915.26
7.3.110.0080.00815.52
7.3.100.0060.01015.55
7.3.90.0100.00615.27
7.3.80.0080.00315.61
7.3.70.0070.00915.42
7.3.60.0030.00915.54
7.3.50.0000.01015.50
7.3.40.0090.00515.63
7.3.30.0120.00315.66
7.3.20.0050.01017.33
7.3.10.0080.00717.45
7.3.00.0050.00817.29
7.2.330.0090.00916.43
7.2.320.0090.01516.36
7.2.310.0090.00916.51
7.2.300.0100.00716.79
7.2.290.0100.00916.72
7.2.260.0090.00916.27
7.2.250.0060.01315.92
7.2.240.0090.01015.40
7.2.230.0080.00715.64
7.2.220.0080.00615.96
7.2.210.0050.00715.93
7.2.200.0050.00915.85
7.2.190.0040.00915.90
7.2.180.0030.00615.75
7.2.170.0070.00915.61
7.2.160.0090.00316.32
7.2.150.0060.00918.16
7.2.140.0040.00718.30
7.2.130.0000.01418.18
7.2.120.0030.00818.34
7.2.110.0060.00918.18
7.2.100.0040.01118.31
7.2.90.0060.00618.48
7.2.80.0040.00818.03
7.2.70.0090.00618.55
7.2.60.0110.00717.43
7.2.50.0040.01118.21
7.2.40.0070.01018.39
7.2.30.0040.00818.10
7.2.20.0110.00418.56
7.2.10.0050.00718.28
7.2.00.0100.00318.21
7.1.330.0120.00016.54
7.1.320.0060.00816.44
7.1.310.0050.00916.70
7.1.300.0050.00816.42
7.1.290.0030.00816.54
7.1.280.0080.00516.54
7.1.270.0040.00616.47
7.1.260.0050.01016.48
7.1.250.0060.00617.26
7.1.240.0030.00917.19
7.1.230.0080.00617.27
7.1.220.0060.00916.98
7.1.210.0080.00317.40
7.1.200.0100.00416.46
7.1.190.0050.00517.39
7.1.180.0030.00717.11
7.1.170.0040.00717.38
7.1.160.0060.01017.21
7.1.150.0060.00617.36
7.1.140.0160.00317.38
7.1.130.0060.00817.20
7.1.120.0030.01017.41
7.1.110.0040.01217.35
7.1.100.0000.01317.53
7.1.90.0030.01417.29
7.1.80.0100.00317.14
7.1.70.0060.00517.38
7.1.60.0120.00818.24
7.1.50.0070.01017.15
7.1.40.0040.00417.36
7.1.30.0000.01317.25
7.1.20.0120.00317.31
7.1.10.0030.01417.41
7.1.00.0050.04019.76
7.0.330.0040.00716.93
7.0.320.0090.00316.62
7.0.310.0070.00716.88
7.0.300.0030.00616.86
7.0.290.0030.00716.88
7.0.280.0060.00616.80
7.0.270.0120.00416.84
7.0.260.0090.00316.75
7.0.250.0000.01117.09
7.0.240.0100.00016.85
7.0.230.0000.01016.83
7.0.220.0080.00317.04
7.0.210.0060.00616.85
7.0.200.0080.01116.89
7.0.190.0070.00717.10
7.0.180.0030.00716.95
7.0.170.0030.00917.14
7.0.160.0030.00617.23
7.0.150.0060.00617.11
7.0.140.0050.04019.55
7.0.130.0070.00417.00
7.0.120.0060.00917.04
7.0.110.0090.00616.96
7.0.100.0070.01016.93
7.0.90.0040.00716.97
7.0.80.0100.00316.71
7.0.70.0030.01216.74
7.0.60.0070.04418.38
7.0.50.0070.04317.41
7.0.40.0070.04717.62
7.0.30.0190.03817.44
7.0.20.0150.03017.42
7.0.10.0030.04317.45
7.0.00.0090.04217.62
5.6.400.0040.00916.16
5.6.390.0030.00915.80
5.6.380.0000.01315.50
5.6.370.0110.00315.31
5.6.360.0060.00915.43
5.6.350.0100.00016.09
5.6.340.0030.00916.00
5.6.330.0070.00315.63
5.6.320.0030.01015.86
5.6.310.0060.00315.65
5.6.300.0140.00016.26
5.6.290.0000.01315.96
5.6.280.0030.03918.59
5.6.270.0000.01815.83
5.6.260.0100.00715.94
5.6.250.0000.00915.92
5.6.240.0030.00616.25
5.6.230.0030.00615.66
5.6.220.0030.01015.62
5.6.210.0090.03018.20
5.6.200.0080.04217.20
5.6.190.0030.03018.27
5.6.180.0140.04418.19
5.6.170.0130.02218.10
5.6.160.0070.02818.14
5.6.150.0070.02316.98
5.6.140.0100.04017.00
5.6.130.0030.02516.99
5.6.120.0100.04018.39
5.6.110.0100.04318.62
5.6.100.0080.03918.41
5.6.90.0080.04318.37
5.6.80.0090.03518.16
5.6.70.0000.01115.48
5.6.60.0030.01015.60
5.6.50.0000.01115.71
5.6.40.0060.00915.82
5.6.30.0050.00515.45
5.6.20.0120.00315.72
5.6.10.0110.00015.73
5.6.00.0070.00715.97
5.5.380.0090.00615.86
5.5.370.0000.01215.70
5.5.360.0100.00316.09
5.5.350.0170.03818.16
5.5.340.0080.03716.96
5.5.330.0070.02718.13
5.5.320.0140.02917.95
5.5.310.0110.02518.10
5.5.300.0040.02916.86
5.5.290.0080.04216.93
5.5.280.0060.03118.38
5.5.270.0050.02718.46
5.5.260.0100.04018.42
5.5.250.0120.04018.26
5.5.240.0070.04018.04
5.5.230.0040.01115.86
5.5.220.0070.00715.67
5.5.210.0040.01115.97
5.5.200.0000.01015.97
5.5.190.0030.00616.04
5.5.180.0120.00315.75
5.5.170.0000.01215.61
5.5.160.0030.00715.76
5.5.150.0090.00615.82
5.5.140.0040.00815.66
5.5.130.0090.00615.51
5.5.120.0030.00915.91
5.5.110.0100.00315.68
5.5.100.0030.01115.76
5.5.90.0000.01315.87
5.5.80.0030.01215.68
5.5.70.0030.01015.71
5.5.60.0060.00915.82
5.5.50.0070.00715.75
5.5.40.0000.01115.62
5.5.30.0100.00015.89
5.5.20.0030.00615.98
5.5.10.0070.00716.02
5.5.00.0030.01215.66
5.4.450.0400.03416.15
5.4.440.0380.03216.14
5.4.430.0100.02816.12
5.4.420.0440.02816.29
5.4.410.0140.02215.83
5.4.400.0530.03115.80
5.4.390.0590.02515.69
5.4.380.0120.03415.72
5.4.370.0030.02515.90
5.4.360.0090.01815.72
5.4.350.0040.02012.41
5.4.340.0080.01912.36
5.4.330.0060.00012.64
5.4.320.0070.02112.64
5.4.310.0070.02112.58
5.4.300.0040.02212.52
5.4.290.0050.02312.52
5.4.280.0090.01912.50
5.4.270.0040.02112.47
5.4.260.0080.02012.48
5.4.250.0040.02412.41
5.4.240.0040.02112.35
5.4.230.0040.02312.40
5.4.220.0080.02012.35
5.4.210.0070.02012.46
5.4.200.0060.02112.52
5.4.190.0040.02212.48
5.4.180.0060.02012.64
5.4.170.0080.02612.45
5.4.160.0070.02712.59
5.4.150.0040.02112.57
5.4.140.0080.01912.29
5.4.130.0070.02012.24
5.4.120.0070.02312.33
5.4.110.0080.01712.36
5.4.100.0080.02112.33
5.4.90.0030.02312.28
5.4.80.0060.02112.22
5.4.70.0040.02212.28
5.4.60.0060.01812.36
5.4.50.0060.02012.28
5.4.40.0070.02112.42
5.4.30.0070.02112.32
5.4.20.0020.02412.36
5.4.10.0060.01812.29
5.4.00.0080.01812.11
5.3.290.0070.02212.98
5.3.280.0050.02312.96
5.3.270.0050.02112.91
5.3.260.0040.02413.05
5.3.250.0060.02312.91
5.3.240.0070.02412.79
5.3.230.0020.02512.91
5.3.220.0040.02312.87
5.3.210.0100.02012.79
5.3.200.0050.02912.75
5.3.190.0060.02112.82
5.3.180.0040.03112.92
5.3.170.0080.02812.91
5.3.160.0040.02312.92
5.3.150.0040.02412.98
5.3.140.0050.02112.84
5.3.130.0120.01812.87
5.3.120.0070.02212.81
5.3.110.0040.02512.94
5.3.100.0040.02112.64
5.3.90.0060.02012.55
5.3.80.0050.02612.49
5.3.70.0060.02212.63
5.3.60.0060.02312.50
5.3.50.0020.02412.51
5.3.40.0040.02412.60
5.3.30.0040.02212.52
5.3.20.0050.02112.31
5.3.10.0040.02212.23
5.3.00.0020.02412.22
5.2.170.0040.0319.21
5.2.160.0070.0279.21
5.2.150.0050.0319.21
5.2.140.0050.0309.20
5.2.130.0070.0279.16
5.2.120.0060.0339.16
5.2.110.0060.0299.17
5.2.100.0050.0319.17
5.2.90.0040.0309.17
5.2.80.0080.0309.16
5.2.70.0040.0329.16
5.2.60.0040.0329.11
5.2.50.0060.0299.08
5.2.40.0050.0299.06
5.2.30.0060.0289.04
5.2.20.0060.0289.03
5.2.10.0050.0288.93
5.2.00.0050.0298.80
5.1.60.0040.0308.07
5.1.50.0030.0298.06
5.1.40.0060.0238.05
5.1.30.0030.0288.39
5.1.20.0070.0248.41
5.1.10.0040.0278.14
5.1.00.0040.0318.14
5.0.50.0040.0216.63
5.0.40.0020.0216.49
5.0.30.0050.0306.30
5.0.20.0030.0206.27
5.0.10.0030.0206.25
5.0.00.0040.0306.24
4.4.90.0020.0164.78
4.4.80.0010.0174.75
4.4.70.0000.0184.76
4.4.60.0030.0154.76
4.4.50.0010.0184.77
4.4.40.0030.0264.71
4.4.30.0050.0134.76
4.4.20.0010.0174.85
4.4.10.0030.0154.85
4.4.00.0050.0294.75
4.3.110.0020.0164.66
4.3.100.0020.0154.66
4.3.90.0030.0144.64
4.3.80.0040.0234.58
4.3.70.0010.0164.63
4.3.60.0000.0184.63
4.3.50.0030.0214.63
4.3.40.0050.0234.54
4.3.30.0010.0173.34
4.3.20.0030.0153.31
4.3.10.0010.0173.27
4.3.00.0100.0237.21

preferences:
42.02 ms | 401 KiB | 5 Q