3v4l.org

run code in 300+ PHP versions simultaneously
<?php function permuteUnique($items, $perms = [], &$return = []) { if (empty($items)) { $return[] = $perms; } else { sort($items); $prev = false; for ($i = count($items) - 1; $i >= 0; --$i) { $newitems = $items; $tmp = array_splice($newitems, $i, 1)[0]; if ($tmp != $prev) { $prev = $tmp; $newperms = $perms; array_unshift($newperms, $tmp); permuteUnique($newitems, $newperms, $return); } } return $return; } } $permutations = permuteUnique(["x1", "x2", "x3"]); var_dump($permutations);

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.00718.30
8.3.50.0120.00821.99
8.3.40.0120.00318.77
8.3.30.0070.00720.20
8.3.20.0000.00818.83
8.3.10.0040.00420.97
8.3.00.0060.00319.81
8.2.180.0070.01518.54
8.2.170.0090.00622.96
8.2.160.0070.00720.35
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00020.94
8.2.110.0060.00320.55
8.2.100.0000.01217.91
8.2.90.0040.00419.20
8.2.80.0040.00419.39
8.2.70.0020.01317.50
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0040.00419.48
8.2.20.0000.00817.81
8.2.10.0000.00817.79
8.2.00.0090.00317.73
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0090.00028.09
8.1.240.0060.00322.59
8.1.230.0110.00020.85
8.1.220.0000.00918.77
8.1.210.0080.00018.85
8.1.200.0090.00517.10
8.1.190.0000.00817.40
8.1.180.0060.00318.10
8.1.170.0060.00318.52
8.1.160.0030.00518.91
8.1.150.0030.00618.66
8.1.140.0040.00417.36
8.1.130.0030.00317.86
8.1.120.0040.00417.51
8.1.110.0000.00817.51
8.1.100.0040.00417.37
8.1.90.0050.00317.51
8.1.80.0030.00317.52
8.1.70.0000.00717.45
8.1.60.0050.00517.57
8.1.50.0040.00417.41
8.1.40.0040.00417.44
8.1.30.0030.00517.61
8.1.20.0050.00317.58
8.1.10.0080.00017.63
8.1.00.0000.00817.51
8.0.300.0080.00020.02
8.0.290.0000.00717.04
8.0.280.0060.00318.36
8.0.270.0030.00317.25
8.0.260.0000.00716.84
8.0.250.0040.00417.00
8.0.240.0060.00316.88
8.0.230.0000.00816.91
8.0.220.0000.00816.89
8.0.210.0020.00516.83
8.0.200.0000.00716.85
8.0.190.0030.00516.99
8.0.180.0040.00417.01
8.0.170.0070.00016.88
8.0.160.0000.00716.91
8.0.150.0040.00416.91
8.0.140.0030.00716.90
8.0.130.0030.00313.39
8.0.120.0000.00916.90
8.0.110.0000.00716.95
8.0.100.0000.00716.89
8.0.90.0040.00417.04
8.0.80.0160.00616.85
8.0.70.0040.00416.92
8.0.60.0050.00217.05
8.0.50.0030.00616.79
8.0.30.0080.01217.12
8.0.20.0120.01217.40
8.0.10.0000.00817.12
8.0.00.0150.00416.66
7.4.330.0000.00516.77
7.4.320.0030.00316.59
7.4.300.0000.00716.66
7.4.290.0000.00716.55
7.4.280.0000.00716.54
7.4.270.0070.00016.54
7.4.260.0030.00313.27
7.4.250.0040.00416.61
7.4.240.0000.00816.66
7.4.230.0070.00016.52
7.4.220.0110.00616.44
7.4.210.0090.00616.65
7.4.200.0040.00416.38
7.4.190.0070.00016.64
7.4.160.0110.00516.42
7.4.150.0070.01317.40
7.4.140.0150.00917.86
7.4.130.0050.01616.66
7.4.120.0060.01316.55
7.4.110.0030.01516.59
7.4.100.0110.00716.59
7.4.90.0100.00916.50
7.4.80.0030.01319.39
7.4.70.0150.00316.57
7.4.60.0070.01016.50
7.4.50.0030.00616.59
7.4.40.0070.01022.77
7.4.30.0140.00316.68
7.4.00.0040.01114.96
7.3.330.0050.00013.32
7.3.320.0050.00013.25
7.3.310.0080.00016.25
7.3.300.0030.00316.41
7.3.290.0100.00316.46
7.3.280.0090.00916.41
7.3.270.0160.00717.40
7.3.260.0170.00618.24
7.3.250.0080.01516.37
7.3.240.0030.01316.45
7.3.230.0140.00416.39
7.3.210.0060.01216.60
7.3.200.0140.01019.39
7.3.190.0080.01216.61
7.3.180.0050.01116.47
7.3.170.0210.00016.46
7.3.160.0140.00816.61
7.3.120.0070.01114.84
7.2.330.0130.00616.43
7.2.320.0170.00616.52
7.2.310.0110.01416.89
7.2.300.0000.01716.79
7.2.290.0120.00616.68
7.2.00.0030.01019.42
7.1.200.0000.01515.92
7.1.100.0030.00918.37
7.1.70.0030.00617.34
7.1.60.0100.00017.17
7.1.50.0040.00717.06
7.1.40.0070.01716.46
7.1.30.0040.01216.70
7.1.20.0090.00616.75
7.1.10.0030.01616.71
7.1.00.0030.00716.73
7.0.200.0040.00416.80
7.0.190.0030.00316.47
7.0.180.0080.00516.46
7.0.170.0050.00516.39
7.0.160.0000.00816.57
7.0.150.0030.01316.44
7.0.140.0030.00616.45
7.0.130.0070.00416.46
7.0.120.0040.00716.38
7.0.110.0040.01416.20
7.0.100.0030.01416.30
7.0.90.0000.00916.18
7.0.80.0040.01316.44
7.0.70.0000.01716.20
7.0.60.0000.01116.31
7.0.50.0080.00316.57
7.0.40.0000.01014.80
7.0.30.0000.01014.80
7.0.20.0030.00714.80
7.0.10.0040.00414.80
7.0.00.0000.00914.80
5.6.300.0140.05120.88
5.6.290.0000.04820.99
5.6.280.0070.04320.85
5.6.270.0030.05121.04
5.6.260.0030.05121.00
5.6.250.0070.04620.79
5.6.240.0060.04220.99
5.6.230.0030.05220.79
5.6.220.0070.08120.79
5.6.210.0030.05220.96
5.6.200.0030.04421.00
5.6.190.0070.03920.89
5.6.180.0070.04320.96
5.6.170.0030.04920.87
5.6.160.0130.06320.82
5.6.150.0070.07920.83
5.6.140.0100.03621.04
5.6.130.0040.04321.05
5.6.120.0000.04920.82
5.6.110.0030.04520.81
5.6.100.0030.04620.79
5.6.90.0030.04620.84
5.6.80.0030.04620.25
5.6.70.0030.04920.19
5.6.60.0060.03720.41
5.6.50.0290.03520.21
5.6.40.0070.08120.32
5.6.30.0040.03920.41
5.6.20.0000.04220.34
5.6.10.0000.04620.09
5.6.00.0140.03120.17
5.5.380.0030.04217.68
5.5.370.0100.03717.52
5.5.360.0030.09417.46
5.5.350.0030.04517.52
5.5.340.0030.04218.14
5.5.330.0030.04218.19
5.5.320.0000.04618.03
5.5.310.0000.04317.86
5.5.300.0070.03618.05
5.5.290.0030.04118.18
5.5.280.0030.04018.03
5.5.270.0100.04217.85
5.5.260.0030.04518.17
5.5.250.0030.04417.94
5.5.240.0070.04017.09
5.5.230.0000.04817.47
5.5.220.0030.08017.50
5.5.210.0100.07317.24
5.5.200.0000.04217.45
5.5.190.0100.04017.40
5.5.180.0000.04117.49
5.5.160.0070.07017.41
5.5.150.0070.03717.43
5.5.140.0030.04317.35
5.5.130.0030.03817.39
5.5.120.0000.04517.41
5.5.110.0070.04017.20
5.5.100.0030.04117.43
5.5.90.0060.03517.31
5.5.80.0070.07517.34
5.5.70.0030.06317.27
5.5.60.0000.04017.33
5.5.50.0070.03717.42
5.5.40.0000.04416.95
5.5.30.0070.03716.98
5.5.20.0070.05117.30
5.5.10.0030.06017.27
5.5.00.0030.04817.27
5.4.450.0070.04219.41
5.4.440.0000.06719.54
5.4.430.0030.04319.21
5.4.420.0100.03619.41
5.4.410.0000.04319.32
5.4.400.0030.04219.10
5.4.390.0070.04019.09
5.4.380.0030.04619.21
5.4.370.0030.03718.93
5.4.360.0000.08019.08
5.4.350.0100.04518.92
5.4.340.0030.04119.23
5.4.320.0030.08319.09
5.4.310.0070.03418.98
5.4.300.0030.04518.92
5.4.290.0070.06318.98
5.4.280.0070.04919.20
5.4.270.0030.03718.92
5.4.260.0000.05218.93
5.4.250.0070.03319.14
5.4.240.0030.06218.92
5.4.230.0000.04318.98
5.4.220.0070.03419.07
5.4.210.0030.03618.98
5.4.200.0000.05918.98
5.4.190.0000.04018.94
5.4.180.0030.05918.89
5.4.170.0160.04318.97
5.4.160.0060.03919.18
5.4.150.0030.04218.93
5.4.140.0100.03016.68
5.4.130.0030.03516.67
5.4.120.0060.03216.51
5.4.110.0070.03816.41
5.4.100.0040.03616.70
5.4.90.0000.03716.63
5.4.80.0070.03116.73
5.4.70.0060.04216.73
5.4.60.0030.03716.71
5.4.50.0060.03116.71
5.4.40.0030.03416.67
5.4.30.0100.03316.49
5.4.20.0030.03416.39
5.4.10.0030.04216.41
5.4.00.0060.02915.94
5.3.290.0030.05214.85
5.3.280.0060.03914.80
5.3.270.0030.03914.91
5.3.260.0000.04014.80
5.3.250.0030.06814.80
5.3.240.0060.03114.80
5.3.230.0000.04114.80
5.3.220.0070.03414.80
5.3.210.0000.04614.80
5.3.200.0030.03614.83
5.3.190.0000.03914.80
5.3.180.0040.03514.84
5.3.170.0000.03814.82
5.3.160.0000.03814.80
5.3.150.0260.03214.80
5.3.140.0000.03814.87
5.3.130.0000.04014.80
5.3.120.0060.03514.80
5.3.110.0000.04314.80
5.3.100.0060.03214.80
5.3.90.0060.03514.80
5.3.80.0000.03714.80
5.3.70.0070.03014.80
5.3.60.0130.02914.80
5.3.50.0030.03614.80
5.3.40.0030.03514.80
5.3.30.0060.03614.80
5.3.20.0000.03614.80
5.3.10.0030.03414.80
5.3.00.0060.03214.80
5.2.170.0000.03614.80
5.2.160.0000.03314.80
5.2.150.0000.04014.80
5.2.140.0060.03214.80
5.2.130.0000.04914.80
5.2.120.0060.02514.80
5.2.110.0000.03814.80
5.2.100.0000.03914.80
5.2.90.0030.03514.80
5.2.80.0000.03414.80
5.2.70.0000.04314.80
5.2.60.0070.03514.80
5.2.50.0000.03414.80
5.2.40.0030.02614.80
5.2.30.0030.04214.80
5.2.20.0030.02914.80
5.2.10.0000.04714.80
5.2.00.0070.02614.80
5.1.60.0190.02214.80
5.1.50.0000.02714.80
5.1.40.0000.02614.80
5.1.30.0000.03214.80
5.1.20.0070.02314.80
5.1.10.0030.02614.80
5.1.00.0070.02014.80
5.0.50.0000.02314.80
5.0.40.0000.02314.80
5.0.30.0000.03414.80
5.0.20.0000.02014.80
5.0.10.0000.02114.80
5.0.00.0000.04014.80
4.4.90.0030.01514.80
4.4.80.0030.02414.80
4.4.70.0000.02014.80
4.4.60.0030.01314.80
4.4.50.0030.01314.80
4.4.40.0070.02314.80
4.4.30.0030.01714.80
4.4.20.0030.01814.80
4.4.10.0000.01714.80
4.4.00.0030.02514.80
4.3.110.0000.01914.80
4.3.100.0000.01714.80
4.3.90.0030.01314.80
4.3.80.0000.02714.80
4.3.70.0000.01714.80
4.3.60.0000.01714.80
4.3.50.0030.01414.80
4.3.40.0060.02314.80
4.3.30.0000.01714.80
4.3.20.0000.01814.80
4.3.10.0030.02914.80
4.3.00.0030.03414.80

preferences:
45.23 ms | 401 KiB | 5 Q