3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "800"; function getCombinations($array) { //initalize array $results = [[]]; //get all combinations foreach ($array as $k => $element) { foreach ($results as $combination) $results[] = $combination + [$k => $element]; } //return filtered array return array_values(array_filter($results)); } $arr = getCombinations(str_split($str, "")); foreach($arr as $v) echo implode(" ", $v) . "<br />";

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.0090.01216.88
8.3.50.0180.00316.35
8.3.40.0140.00018.79
8.3.30.0070.01418.73
8.3.20.0040.00420.34
8.3.10.0080.00021.73
8.3.00.0040.00423.66
8.2.180.0120.00916.75
8.2.170.0120.00622.96
8.2.160.0030.01020.47
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00021.12
8.2.120.0040.00426.35
8.2.110.0100.00019.19
8.2.100.0120.00017.93
8.2.90.0040.00419.27
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0000.00817.65
8.2.50.0040.00418.07
8.2.40.0000.00822.20
8.2.30.0050.00319.40
8.2.20.0000.00717.60
8.2.10.0030.00518.05
8.2.00.0080.00018.13
8.1.280.0140.00325.92
8.1.270.0110.00323.84
8.1.260.0040.00428.09
8.1.250.0050.00328.09
8.1.240.0050.00520.60
8.1.230.0150.00317.64
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0040.00418.46
8.1.160.0030.00520.64
8.1.150.0030.00620.52
8.1.140.0040.00419.57
8.1.130.0000.00717.68
8.1.120.0000.00817.49
8.1.110.0000.00717.46
8.1.100.0040.00417.25
8.1.90.0030.00617.43
8.1.80.0000.00917.44
8.1.70.0030.00317.45
8.1.60.0060.00317.60
8.1.50.0000.00817.59
8.1.40.0060.00617.41
8.1.30.0090.00017.56
8.1.20.0000.00717.70
8.1.10.0000.00817.60
8.1.00.0020.00517.51
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0040.00418.44
8.0.270.0030.00317.26
8.0.260.0030.00617.12
8.0.250.0000.00716.91
8.0.240.0000.00616.98
8.0.230.0070.00017.00
8.0.220.0050.00316.94
8.0.210.0000.00716.89
8.0.200.0060.00016.96
8.0.190.0050.00316.98
8.0.180.0000.00716.91
8.0.170.0000.00716.89
8.0.160.0040.00416.86
8.0.150.0040.00416.90
8.0.140.0000.00716.84
8.0.130.0000.00513.35
8.0.120.0040.00416.84
8.0.110.0080.00016.84
8.0.100.0000.00716.86
8.0.90.0040.00417.00
8.0.80.0050.00916.94
8.0.70.0070.00016.89
8.0.60.0040.00416.79
8.0.50.0040.00416.80
8.0.30.0050.01317.01
8.0.20.0100.00917.40
8.0.10.0020.00517.09
8.0.00.0120.00716.76
7.4.330.0000.00516.70
7.4.320.0060.00016.41
7.4.300.0030.00616.63
7.4.290.0000.00616.42
7.4.280.0030.00616.50
7.4.270.0070.00016.66
7.4.260.0030.00316.54
7.4.250.0080.00016.55
7.4.240.0020.00516.50
7.4.230.0070.00016.31
7.4.220.0160.00916.64
7.4.210.0030.01416.72
7.4.200.0000.00716.35
7.4.160.0080.00816.51
7.4.150.0140.00717.40
7.4.140.0140.00817.86
7.4.130.0080.01416.66
7.4.120.0080.01016.65
7.4.110.0170.00016.53
7.4.100.0070.01116.58
7.4.90.0100.00716.57
7.4.80.0100.00719.39
7.4.70.0140.00716.52
7.4.60.0060.01016.64
7.4.50.0090.00316.37
7.4.40.0000.01616.51
7.4.30.0150.00616.70
7.4.10.0070.00714.86
7.4.00.0050.01115.00
7.3.330.0060.00013.20
7.3.320.0030.00313.29
7.3.310.0040.00416.31
7.3.300.0000.00716.24
7.3.290.0130.00616.34
7.3.280.0090.01016.37
7.3.270.0060.01617.40
7.3.260.0070.01016.49
7.3.250.0090.00916.43
7.3.240.0120.00716.40
7.3.230.0110.00616.39
7.3.210.0100.00716.33
7.3.200.0060.00919.39
7.3.190.0030.01516.64
7.3.180.0150.00316.30
7.3.170.0080.01116.58
7.3.160.0110.01416.53
7.3.130.0090.00615.12
7.3.120.0110.00714.89
7.3.110.0100.00714.86
7.3.100.0000.01415.12
7.3.90.0050.00815.03
7.3.80.0030.01414.90
7.3.70.0060.00914.92
7.3.60.0030.01314.84
7.3.50.0100.01014.54
7.3.40.0060.00914.70
7.3.30.0060.01014.78
7.3.20.0030.01316.56
7.3.10.0040.00716.79
7.3.00.0050.00516.48
7.2.330.0070.01016.68
7.2.320.0090.01016.78
7.2.310.0100.00716.74
7.2.300.0070.01016.61
7.2.290.0150.00616.57
7.2.260.0060.01214.88
7.2.250.0090.00615.27
7.2.240.0090.00614.76
7.2.230.0100.00715.28
7.2.220.0040.00914.90
7.2.210.0030.00715.14
7.2.200.0060.00615.24
7.2.190.0100.01015.04
7.2.180.0060.01315.14
7.2.170.0000.01415.07
7.2.160.0070.01014.95
7.2.150.0070.01016.83
7.2.140.0030.00616.95
7.2.130.0030.00916.96
7.2.120.0080.00616.92
7.2.110.0100.00617.07
7.2.100.0060.00617.03
7.2.90.0090.00316.72
7.2.80.0060.00916.95
7.2.70.0000.01416.95
7.2.60.0040.00616.57
7.2.50.0090.00617.02
7.2.40.0000.01416.91
7.2.30.0040.01117.08
7.2.20.0060.00916.89
7.2.10.0030.01217.03
7.2.00.0000.01718.14
7.1.330.0040.00815.70
7.1.320.0030.01415.89
7.1.310.0000.01415.89
7.1.300.0060.01215.71
7.1.290.0070.00715.76
7.1.280.0030.01015.75
7.1.270.0040.01215.59
7.1.260.0030.00915.74
7.1.250.0030.00615.73
7.1.240.0000.01115.80
7.1.230.0040.00715.88
7.1.220.0070.00715.48
7.1.210.0090.00615.63
7.1.200.0060.00515.84
7.1.190.0070.00715.70
7.1.180.0060.00915.72
7.1.170.0040.01215.88
7.1.160.0040.00715.65
7.1.150.0040.01215.90
7.1.140.0030.01215.81
7.1.130.0030.01115.73
7.1.120.0030.01315.73
7.1.110.0110.00415.65
7.1.100.0090.00317.02
7.1.90.0110.00015.89
7.1.80.0040.00415.85
7.1.70.0030.00616.58
7.1.60.0070.00917.67
7.1.50.0030.00716.36
7.1.40.0030.01015.82
7.1.30.0110.00415.64
7.1.20.0000.00915.68
7.1.10.0070.00715.87
7.1.00.0050.04219.01
7.0.330.0070.00715.42
7.0.320.0030.00615.12
7.0.310.0030.01415.45
7.0.300.0070.00715.29
7.0.290.0070.00715.13
7.0.280.0030.01015.09
7.0.270.0040.00715.38
7.0.260.0030.01015.35
7.0.250.0070.00715.40
7.0.240.0000.01115.34
7.0.230.0030.01015.60
7.0.220.0000.01215.41
7.0.210.0090.00615.42
7.0.200.0120.01115.26
7.0.190.0000.00815.40
7.0.180.0030.00615.41
7.0.170.0090.00015.38
7.0.160.0070.00715.19
7.0.150.0080.00015.51
7.0.140.0000.01315.31
7.0.130.0080.00815.58
7.0.120.0040.01215.30
7.0.110.0060.00915.46
7.0.100.0070.00715.59
7.0.90.0110.00315.15
7.0.80.0040.00815.33
7.0.70.0000.01215.18
7.0.60.0090.03218.36
7.0.50.0020.03016.60
7.0.40.0020.03116.82
7.0.30.0220.03416.73
7.0.20.0210.02416.92
7.0.10.0070.03016.92
7.0.00.0040.02516.84
5.6.400.0040.00714.44
5.6.390.0090.00614.38
5.6.380.0090.00613.97
5.6.370.0070.01013.92
5.6.360.0070.00714.42
5.6.350.0000.01413.97
5.6.340.0100.00714.20
5.6.330.0060.00914.66
5.6.320.0030.00914.05
5.6.310.0000.01514.57
5.6.300.0030.00814.28
5.6.290.0080.00814.22
5.6.280.0080.03217.54
5.6.270.0080.00614.20
5.6.260.0040.01114.19
5.6.250.0020.01013.96
5.6.240.0080.00814.11
5.6.230.0040.01114.05
5.6.220.0060.00914.42
5.6.210.0070.04217.46
5.6.200.0070.04716.19
5.6.190.0070.03017.35
5.6.180.0180.04317.30
5.6.170.0120.02917.27
5.6.160.0030.03417.45
5.6.150.0100.04316.34
5.6.140.0030.02616.38
5.6.130.0030.02516.32
5.6.120.0030.02517.51
5.6.110.0050.04417.57
5.6.100.0050.02617.72
5.6.90.0070.04517.64
5.6.80.0030.03217.40
5.6.70.0030.00614.35
5.6.60.0080.00414.35
5.6.50.0000.01414.16
5.6.40.0090.00614.05
5.6.30.0070.00314.00
5.6.20.0030.00614.12
5.6.10.0070.00714.28
5.6.00.0090.00614.28
5.5.380.0080.00614.21
5.5.370.0030.01014.18
5.5.360.0060.00313.98
5.5.350.1850.02217.35
5.5.340.0070.03416.07
5.5.330.0080.04117.30
5.5.320.0240.04217.07
5.5.310.0160.03517.21
5.5.300.0060.02316.08
5.5.290.0090.02216.04
5.5.280.0080.04117.53
5.5.270.0050.02417.53
5.5.260.0050.03517.54
5.5.250.0030.04817.45
5.5.240.0070.03917.16
5.5.230.0040.00813.97
5.5.220.0090.00914.36
5.5.210.0000.01314.06
5.5.200.0070.00714.20
5.5.190.0000.01414.16
5.5.180.0100.00613.95
5.5.170.0080.00814.05
5.5.160.0140.00314.18
5.5.150.0070.01114.13
5.5.140.0090.00914.16
5.5.130.0120.00613.85
5.5.120.0080.00614.12
5.5.110.0060.00814.11
5.5.100.0030.00714.27
5.5.90.0030.01013.99
5.5.80.0060.00914.09
5.5.70.0060.00614.21
5.5.60.0100.00614.05
5.5.50.0070.00713.95
5.5.40.0100.00314.18
5.5.30.0040.00713.74
5.5.20.0040.00414.02
5.5.10.0040.00814.23
5.5.00.0000.01313.88

preferences:
55.64 ms | 400 KiB | 5 Q