3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'ABC1'; permute(str_split($str), 0, strlen($str)); function permute($arr, $i, $n) { if ($i == $n) { printArray($arr); return; } for ($j = $i; $j < $n; $j += 1) { swapArrayValues($arr, $i, $j); permute($arr, $i + 1, $n); swapArrayValues($arr, $i, $j); } } function swapArrayValues(&$array, $i, $j) { $tmp = $array[$i]; $array[$i] = $array[$j]; $array[$j] = $tmp; } function printArray($arr) { echo implode($arr, ' ') . "\n"; }

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.0130.00718.43
8.3.50.0120.00621.92
8.3.40.0070.00718.79
8.3.30.0100.00618.66
8.3.20.0080.00018.91
8.3.10.0040.00421.04
8.3.00.0030.00621.78
8.2.180.0090.00618.41
8.2.170.0070.00722.96
8.2.160.0070.00720.53
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0050.00319.36
8.2.110.0070.00320.44
8.2.100.0070.00417.91
8.2.90.0080.00019.17
8.2.80.0060.00317.97
8.2.70.0050.00317.63
8.2.60.0000.00818.04
8.2.50.0000.00918.07
8.2.40.0000.00818.28
8.2.30.0000.00819.77
8.2.20.0000.00817.61
8.2.10.0000.00817.79
8.2.00.0040.00417.82
8.1.280.0110.00425.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00022.46
8.1.230.0040.00820.97
8.1.220.0000.00818.77
8.1.210.0080.00018.91
8.1.200.0030.00617.36
8.1.190.0030.00519.18
8.1.180.0000.00818.10
8.1.170.0040.00418.50
8.1.160.0040.00418.91
8.1.150.0060.00318.56
8.1.140.0030.00517.48
8.1.130.0000.00717.84
8.1.120.0070.00017.48
8.1.110.0000.00817.47
8.1.100.0030.00617.55
8.1.90.0040.00417.43
8.1.80.0000.00817.36
8.1.70.0030.00317.42
8.1.60.0060.00317.61
8.1.50.0040.00417.39
8.1.40.0000.00817.50
8.1.30.0040.00417.49
8.1.20.0040.00417.68
8.1.10.0040.00417.58
8.1.00.0030.00517.50
8.0.300.0000.00720.02
8.0.290.0040.00416.93
8.0.280.0000.00718.28
8.0.270.0000.00717.13
8.0.260.0030.00316.84
8.0.250.0000.00716.98
8.0.240.0030.00516.94
8.0.230.0030.00317.01
8.0.220.0000.00716.95
8.0.210.0070.00016.88
8.0.200.0080.00016.86
8.0.190.0070.00016.95
8.0.180.0080.00016.86
8.0.170.0040.00416.93
8.0.160.0070.00016.94
8.0.150.0040.00416.84
8.0.140.0040.00416.85
8.0.130.0000.00513.38
8.0.120.0030.00616.77
8.0.110.0040.00416.80
8.0.100.0040.00416.82
8.0.90.0040.00416.90
8.0.80.0070.01016.96
8.0.70.0040.00416.97
8.0.60.0050.00216.98
8.0.50.0040.00416.80
8.0.30.0150.00717.07
8.0.20.0160.00317.40
8.0.10.0070.00017.04
8.0.00.0080.01116.88
7.4.330.0020.00213.43
7.4.320.0070.00016.60
7.4.300.0040.00416.63
7.4.290.0000.00916.65
7.4.280.0070.00316.56
7.4.270.0040.00416.50
7.4.260.0060.00013.30
7.4.250.0040.00416.39
7.4.240.0030.00316.53
7.4.230.0030.00316.55
7.4.220.0130.01016.50
7.4.210.0060.01016.56
7.4.200.0070.00016.61
7.4.190.0040.00416.70
7.4.160.0120.00616.57
7.4.150.0100.01017.40
7.4.140.0100.00917.86
7.4.130.0100.00816.60
7.4.120.0110.00716.43
7.4.110.0100.00716.49
7.4.100.0000.02516.63
7.4.90.0130.00616.59
7.4.80.0100.00719.37
7.4.70.0100.01016.38
7.4.60.0100.00616.51
7.4.50.0060.00316.57
7.4.40.0100.00722.27
7.4.30.0070.01016.50
7.4.10.0030.01714.91
7.4.00.0090.00814.94
7.3.330.0000.00513.16
7.3.320.0030.00313.23
7.3.310.0030.00316.19
7.3.300.0070.00016.38
7.3.290.0030.01316.39
7.3.280.0110.00516.37
7.3.270.0120.00617.40
7.3.260.0110.00918.24
7.3.250.0080.01016.53
7.3.240.0080.00816.32
7.3.230.0030.01316.50
7.3.210.0040.01516.54
7.3.200.0110.00819.39
7.3.190.0090.00816.39
7.3.180.0040.01216.46
7.3.170.0040.01216.48
7.3.160.0030.01316.38
7.3.130.0030.01514.84
7.3.120.0070.00814.80
7.3.110.0070.01315.11
7.3.100.0060.00915.05
7.3.90.0090.00614.94
7.3.80.0100.00314.76
7.3.70.0070.00714.85
7.3.60.0040.00814.73
7.3.50.0030.01014.90
7.3.40.0090.00014.95
7.3.30.0100.00314.66
7.3.20.0000.01216.69
7.3.10.0070.00816.54
7.3.00.0030.00916.60
7.2.330.0090.00916.80
7.2.320.0060.01216.83
7.2.310.0100.00716.59
7.2.300.0100.00716.35
7.2.290.0100.00716.77
7.2.260.0070.01414.93
7.2.250.0070.00714.81
7.2.240.0100.00714.91
7.2.230.0030.01015.29
7.2.220.0110.00014.90
7.2.210.0060.00615.05
7.2.200.0000.00915.09
7.2.190.0040.01115.09
7.2.180.0100.00314.84
7.2.170.0060.00615.03
7.2.160.0030.00915.16
7.2.150.0070.01016.68
7.2.140.0070.00717.12
7.2.130.0050.00916.64
7.2.120.0060.00916.65
7.2.110.0100.00716.75
7.2.100.0080.00716.98
7.2.90.0090.00516.88
7.2.80.0100.00816.64
7.2.70.0090.00816.55
7.2.60.0090.00816.93
7.2.50.0100.00616.96
7.2.40.0070.00916.56
7.2.30.0110.01117.11
7.2.20.0160.00216.94
7.2.10.0070.01116.96
7.2.00.0080.01217.79
7.1.330.0030.01316.01
7.1.320.0000.01415.79
7.1.310.0030.01215.88
7.1.300.0060.00915.78
7.1.290.0100.00015.66
7.1.280.0030.00615.81
7.1.270.0090.00615.53
7.1.260.0070.00715.91
7.1.250.0080.00815.66
7.1.240.0060.00615.84
7.1.230.0070.00315.99
7.1.220.0040.01215.88
7.1.210.0050.00515.95
7.1.200.0000.01415.63
7.1.190.0110.00315.73
7.1.180.0070.00415.69
7.1.170.0030.00615.61
7.1.160.0000.01415.96
7.1.150.0040.01115.96
7.1.140.0060.00315.65
7.1.130.0090.00615.86
7.1.120.0070.01015.58
7.1.110.0000.00816.01
7.1.100.0060.00716.81
7.1.90.0000.01716.03
7.1.80.0030.01015.99
7.1.70.0020.00916.30
7.1.60.0100.00617.72
7.1.50.0050.01316.46
7.1.40.0040.01115.58
7.1.30.0040.01416.05
7.1.20.0110.00715.87
7.1.10.0090.00015.68
7.1.00.0050.03019.11
7.0.330.0070.00715.32
7.0.320.0030.01315.44
7.0.310.0030.00615.54
7.0.300.0070.00815.54
7.0.290.0040.01115.46
7.0.280.0030.00915.19
7.0.270.0090.00615.46
7.0.260.0040.00715.54
7.0.250.0000.01315.45
7.0.240.0000.01615.63
7.0.230.0040.01115.61
7.0.220.0070.00715.47
7.0.210.0040.00815.22
7.0.200.0050.00416.13
7.0.190.0030.00515.48
7.0.180.0070.00715.50
7.0.170.0030.00615.59
7.0.160.0080.00315.48
7.0.150.0090.00615.47
7.0.140.0010.04118.77
7.0.130.0030.00515.44
7.0.120.0030.01015.58
7.0.110.0060.00815.35
7.0.100.0030.00615.23
7.0.90.0080.00015.24
7.0.80.0100.00715.39
7.0.70.0030.04518.57
7.0.60.0030.04518.40
7.0.50.0030.04418.64
7.0.40.0070.04016.62
7.0.30.0070.04516.82
7.0.20.0050.04216.78
7.0.10.0020.04416.76
7.0.00.0050.04816.83
5.6.400.0060.00614.50
5.6.390.0120.00014.67
5.6.380.0100.00714.48
5.6.370.0030.01014.70
5.6.360.0070.00314.59
5.6.350.0070.01014.31
5.6.340.0080.00314.39
5.6.330.0090.00614.40
5.6.320.0090.00314.62
5.6.310.0040.00414.78
5.6.300.0140.00314.43
5.6.290.0060.00614.57
5.6.280.0020.04417.89
5.6.270.0100.00314.72
5.6.260.0000.01414.61
5.6.250.0080.00414.25
5.6.240.0090.00614.26
5.6.230.0070.00414.47
5.6.220.0080.03017.42
5.6.210.0080.03917.43
5.6.200.0020.05117.72
5.6.190.0020.03617.75
5.6.180.0050.03817.69
5.6.170.0080.04617.93
5.6.160.0000.03617.64
5.6.150.0030.04817.83
5.6.140.0030.04817.72
5.6.130.0100.03817.64
5.6.120.0080.04417.85
5.6.110.0070.04017.66
5.6.100.0040.03417.90
5.6.90.0060.03017.68
5.6.80.0080.04217.37
5.6.70.0090.03517.21
5.6.60.0060.03517.32
5.6.50.0000.03617.34
5.6.40.0070.03717.28
5.6.30.0050.03217.34
5.6.20.0080.04217.38
5.6.10.0130.03617.49
5.6.00.0050.04117.39
5.5.380.0040.01114.72
5.5.370.0050.00514.09
5.5.360.0110.03317.38
5.5.350.0040.04717.64
5.5.340.0050.03417.50
5.5.330.0020.03117.62
5.5.320.0080.04517.59
5.5.310.0020.03617.70
5.5.300.0070.04317.58
5.5.290.0020.05117.67
5.5.280.0070.03717.78
5.5.270.0090.03817.70
5.5.260.0110.03517.81
5.5.250.0010.03117.55
5.5.240.0060.03517.17
5.5.230.0050.04117.29
5.5.220.0040.04517.29
5.5.210.0080.04317.22
5.5.200.0050.04317.29
5.5.190.0070.03517.06
5.5.180.0050.03317.37
5.5.170.0100.00314.31
5.5.160.0030.04617.18
5.5.150.0020.04616.96
5.5.140.0050.03917.25
5.5.130.0020.04217.26
5.5.120.0050.04117.25
5.5.110.0040.02717.37
5.5.100.0080.04217.13
5.5.90.0030.03117.19
5.5.80.0030.02317.05
5.5.70.0070.03317.29
5.5.60.0070.04017.20
5.5.50.0080.03817.16
5.5.40.0070.04217.28
5.5.30.0070.04217.13
5.5.20.0060.03317.21
5.5.10.0040.04417.14
5.5.00.0030.02517.21
5.4.450.0090.04215.43
5.4.440.0040.03415.60
5.4.430.0050.03715.41
5.4.420.0080.02015.56
5.4.410.0030.03115.52
5.4.400.0020.02615.40
5.4.390.0070.03215.26
5.4.380.0060.03515.34
5.4.370.0030.02815.30
5.4.360.0030.04315.33
5.4.350.0030.02715.34
5.4.340.0020.03515.29
5.4.330.0040.00811.66
5.4.320.0060.02815.37
5.4.310.0030.03515.35
5.4.300.0030.04015.34
5.4.290.0050.03015.25
5.4.280.0050.03115.44
5.4.270.0050.03015.42
5.4.260.0030.04215.35
5.4.250.0030.03115.41
5.4.240.0020.04315.40
5.4.230.0070.04215.29
5.4.220.0000.04315.39
5.4.210.0070.03515.39
5.4.200.0030.04515.39
5.4.190.0070.03715.43
5.4.180.0030.03015.27
5.4.170.0030.02315.39
5.4.160.0040.02515.34
5.4.150.0060.03315.24
5.4.140.0030.02213.99
5.4.130.0020.04114.04
5.4.120.0010.03614.05
5.4.110.0020.03114.07
5.4.100.0030.03914.07
5.4.90.0000.02514.09
5.4.80.0000.04414.06
5.4.70.0030.03814.08
5.4.60.0030.02213.98
5.4.50.0050.02013.95
5.4.40.0020.02014.09
5.4.30.0030.04114.01
5.4.20.0060.03914.06
5.4.10.0020.04013.98
5.4.00.0020.03413.67
5.3.290.0030.03213.13
5.3.280.0030.04013.12
5.3.270.0040.03913.15
5.3.260.0030.02813.09
5.3.250.0000.03013.20
5.3.240.0070.02213.12
5.3.230.0070.03313.10
5.3.220.0040.02813.10
5.3.210.0030.03713.14
5.3.200.0070.02413.11
5.3.190.0030.02213.16
5.3.180.0050.04013.13
5.3.170.0030.03413.16
5.3.160.0050.03813.10
5.3.150.0030.02213.18
5.3.140.0030.02013.09
5.3.130.0080.03613.12
5.3.120.0050.02813.12
5.3.110.0050.02013.14
5.3.100.0060.03912.86
5.3.90.0040.03512.87
5.3.80.0050.02812.87
5.3.70.0030.03012.85
5.3.60.0050.03812.88
5.3.50.0050.04012.76
5.3.40.0050.03812.84
5.3.30.0030.03012.74
5.3.20.0050.02212.64
5.3.10.0000.02212.71
5.3.00.0020.02412.59
5.2.170.0030.04011.04
5.2.160.0070.03711.04
5.2.150.0070.06011.29
5.2.140.0070.04011.05
5.2.130.0000.04311.13
5.2.120.0030.03011.04
5.2.110.0030.05311.12
5.2.100.0000.03011.20
5.2.90.0000.03011.17
5.2.80.0000.06311.09
5.2.70.0030.04011.12
5.2.60.0000.03011.07
5.2.50.0000.04011.12
5.2.40.0000.03711.01
5.2.30.0030.02710.88
5.2.20.0000.03310.87
5.2.10.0030.06010.96
5.2.00.0000.03710.86
5.1.60.0000.04010.48
5.1.50.0000.03710.48
5.1.40.0000.03310.48
5.1.30.0000.06010.48
5.1.20.0000.04010.48
5.1.10.0030.04710.48
5.1.00.0030.04710.48
5.0.50.0070.04310.48
5.0.40.0000.04010.48
5.0.30.0000.04010.48
5.0.20.0030.02710.48
5.0.10.0070.03010.48
5.0.00.0000.05710.48
4.4.90.0000.01710.48
4.4.80.0030.01310.48
4.4.70.0030.02010.48
4.4.60.0030.01710.48
4.4.50.0030.03010.48
4.4.40.0000.02310.48
4.4.30.0000.02010.48
4.4.20.0030.03010.48
4.4.10.0030.03310.48
4.4.00.0030.05310.48
4.3.110.0030.03010.48
4.3.100.0070.02310.48
4.3.90.0000.02010.48
4.3.80.0070.04710.48
4.3.70.0000.03710.48
4.3.60.0000.03710.48
4.3.50.0030.02310.48
4.3.40.0070.04310.48
4.3.30.0000.03310.48
4.3.20.0000.02710.48
4.3.10.0030.03310.48
4.3.00.0000.02310.48

preferences:
44.15 ms | 401 KiB | 5 Q