3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = [1, 2, 3, 4, 5]; $vendors = ["Amazon", "Newegg", "Frys"]; $combinations = Array(); function pc_permute($items, $perms = array()) { if (empty($items)) { //echo join(' ', $perms) . "</br>"; //return $perms; array_push($combinations, $perms); } else { for ($i = count($items) - 1; $i >= 0; --$i) { $newitems = $items; $newperms = $perms; list($foo) = array_splice($newitems, $i, 1); array_unshift($newperms, $foo); pc_permute($newitems, $newperms); } } } pc_permute($products); var_dump($combinations);

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.0120.00818.68
8.3.50.0070.00922.05
8.3.40.0060.00918.79
8.3.30.0030.01020.13
8.3.20.0040.00420.17
8.3.10.0000.00722.27
8.3.00.0000.00822.52
8.2.180.0160.00617.00
8.2.170.0140.00022.96
8.2.160.0110.00422.08
8.2.150.0030.00524.18
8.2.140.0000.00724.66
8.2.130.0100.00326.16
8.2.120.0040.00421.04
8.2.110.0060.00319.38
8.2.100.0030.00918.16
8.2.90.0000.00819.23
8.2.80.0040.00419.41
8.2.70.0040.00417.63
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0040.00418.18
8.2.30.0080.00018.21
8.2.20.0050.00317.80
8.2.10.0000.00717.83
8.2.00.0040.00417.88
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00321.36
8.1.230.0120.00017.83
8.1.220.0050.00317.74
8.1.210.0090.00018.77
8.1.200.0030.00617.35
8.1.190.0000.00717.52
8.1.180.0040.00818.10
8.1.170.0030.00518.63
8.1.160.0040.00418.89
8.1.150.0000.00818.58
8.1.140.0070.00017.48
8.1.130.0040.00417.90
8.1.120.0050.00217.48
8.1.110.0040.00417.49
8.1.100.0040.00417.46
8.1.90.0000.00717.55
8.1.80.0000.00717.52
8.1.70.0030.00317.43
8.1.60.0000.00917.62
8.1.50.0040.00417.55
8.1.40.0000.00817.40
8.1.30.0020.00517.67
8.1.20.0060.00317.57
8.1.10.0040.00417.60
8.1.00.0000.00817.53
8.0.300.0040.00418.77
8.0.290.0070.00017.05
8.0.280.0040.00418.39
8.0.270.0050.00217.18
8.0.260.0060.00016.81
8.0.250.0070.00016.87
8.0.240.0080.00016.97
8.0.230.0000.00716.94
8.0.220.0000.00716.89
8.0.210.0050.00216.87
8.0.200.0000.00817.00
8.0.190.0070.00016.99
8.0.180.0000.00716.92
8.0.170.0040.00417.04
8.0.160.0050.00317.01
8.0.150.0070.00016.92
8.0.140.0080.00016.86
8.0.130.0000.00613.45
8.0.120.0040.00417.04
8.0.110.0000.00717.01
8.0.100.0050.00216.94
8.0.90.0000.00716.88
8.0.80.0090.00916.95
8.0.70.0000.00717.11
8.0.60.0040.00416.88
8.0.50.0000.00717.04
8.0.30.0100.01117.27
8.0.20.0100.01017.40
8.0.10.0060.00317.13
8.0.00.0080.00816.79
7.4.330.0060.00315.00
7.4.320.0030.00316.52
7.4.300.0070.00016.51
7.4.290.0030.00816.58
7.4.280.0000.00716.51
7.4.270.0000.00716.44
7.4.260.0060.00013.21
7.4.250.0000.00716.47
7.4.240.0020.00616.57
7.4.230.0040.00416.59
7.4.220.0150.00616.48
7.4.210.0070.01016.58
7.4.200.0070.00016.31
7.4.190.0070.00016.49
7.4.160.0030.01516.41
7.4.150.0120.00617.40
7.4.140.0150.00717.86
7.4.130.0090.00916.51
7.4.120.0100.01416.65
7.4.110.0070.01116.56
7.4.100.0070.02116.67
7.4.90.0110.00816.41
7.4.80.0000.01919.39
7.4.70.0150.00916.50
7.4.60.0150.00716.47
7.4.50.0060.00316.64
7.4.40.0060.00622.77
7.4.30.0090.00916.39
7.4.00.0100.00514.78
7.3.330.0000.00613.45
7.3.320.0000.00613.29
7.3.310.0020.00516.51
7.3.300.0000.00816.43
7.3.290.0040.01116.43
7.3.280.0070.01016.41
7.3.270.0050.01417.40
7.3.260.0110.01416.66
7.3.250.0140.00816.55
7.3.240.0140.00516.41
7.3.230.0060.01316.46
7.3.210.0090.00916.36
7.3.200.0110.01119.39
7.3.190.0030.01616.63
7.3.180.0000.01716.30
7.3.170.0140.00816.39
7.3.160.0090.00816.56
7.3.120.0080.00814.96
7.3.110.0080.00915.04
7.3.100.0060.00614.98
7.3.90.0120.00315.10
7.3.80.0060.01214.93
7.3.70.0070.00714.67
7.3.60.0030.01014.95
7.3.50.0060.00914.55
7.3.40.0090.00314.60
7.3.30.0000.01114.77
7.3.20.0040.00816.91
7.3.10.0000.01516.65
7.3.00.0040.01116.89
7.2.330.0030.01616.57
7.2.320.0090.01216.68
7.2.310.0090.00916.71
7.2.300.0150.00416.45
7.2.290.0100.00716.45
7.2.250.0030.01715.17
7.2.240.0040.01414.96
7.2.230.0150.00315.19
7.2.220.0060.01015.23
7.2.210.0030.01614.77
7.2.200.0030.00915.01
7.2.190.0110.00415.14
7.2.180.0090.00015.16
7.2.170.0040.00915.09
7.2.80.0040.01116.77
7.2.60.0110.00416.84
7.2.50.0190.00416.90
7.1.330.0100.00715.50
7.1.320.0070.00715.81
7.1.310.0100.01015.92
7.1.300.0030.00915.88
7.1.290.0030.01315.84
7.1.280.0000.00915.74
7.1.270.0000.01515.88
7.1.260.0000.01315.58
7.1.200.0080.00415.67
7.1.70.0000.00817.19
7.1.60.0030.02319.32
7.1.50.0060.01617.10
7.1.00.0070.07022.54
7.0.200.0050.00516.85
7.0.140.0030.07321.99
7.0.100.0000.04019.88
7.0.90.0030.04019.89
7.0.80.0030.05019.84
7.0.70.0230.08319.85
7.0.60.0370.08719.91
7.0.50.0500.06720.31
7.0.40.0230.05319.95
7.0.30.0030.06320.13
7.0.20.0130.07720.13
7.0.10.0200.07320.05
7.0.00.0000.09020.04
5.6.280.0070.07321.07
5.6.250.0070.03720.48
5.6.240.0030.04320.46
5.6.230.0000.05020.45
5.6.220.0030.06020.53
5.6.210.0100.03720.63
5.6.200.0030.08020.99
5.6.190.0070.05321.06
5.6.180.0030.05720.99
5.6.170.0130.07720.89
5.6.160.0100.05320.99
5.6.150.0100.08021.12
5.6.140.0130.07021.01
5.6.130.0130.07320.90
5.6.120.0030.07721.02
5.6.110.0070.06720.96
5.6.100.0000.09020.95
5.6.90.0170.07320.94
5.6.80.0170.07320.45
5.6.70.0000.09320.24
5.6.60.0070.05320.43
5.6.50.0170.06320.36
5.6.40.0100.08020.33
5.6.30.0030.07320.39
5.6.20.0130.06320.25
5.6.10.0100.05020.39
5.6.00.0030.08720.39
5.5.380.0030.04320.46
5.5.370.0030.03720.35
5.5.360.0070.08020.30
5.5.350.0100.08320.34
5.5.340.0070.04720.82
5.5.330.0230.06020.84
5.5.320.0170.06320.69
5.5.310.0070.05720.88
5.5.300.0130.05020.84
5.5.290.0000.08320.73
5.5.280.0030.07720.56
5.5.270.0100.05320.75
5.5.260.0100.08720.74
5.5.250.0170.07320.66
5.5.240.0070.08020.20
5.5.230.0130.07720.09
5.5.220.0070.07720.10
5.5.210.0130.07020.19
5.5.200.0070.08320.13
5.5.190.0070.08020.10
5.5.180.0100.07720.19
5.5.160.0100.08020.06
5.5.150.0100.06320.13
5.5.140.0030.04720.20
5.5.130.0070.08020.21
5.5.120.0070.08020.09
5.5.110.0100.07320.05
5.5.100.0070.04320.01
5.5.90.0070.08320.07
5.5.80.0170.04320.00
5.5.70.0100.05720.01
5.5.60.0100.08020.00
5.5.50.0000.07720.10
5.5.40.0070.08020.01
5.5.30.0100.07719.88
5.5.20.0200.07020.09
5.5.10.0030.07720.07
5.5.00.0100.04719.98
5.4.450.0030.08319.23
5.4.440.0100.09019.45
5.4.430.0100.08019.17
5.4.420.0100.04019.41
5.4.410.0030.07019.32
5.4.400.0170.06018.87
5.4.390.0130.07019.05
5.4.380.0100.07019.05
5.4.370.0070.05019.00
5.4.360.0170.06718.90
5.4.350.0130.07019.05
5.4.340.0100.07318.88
5.4.320.0070.07319.21
5.4.310.0070.07719.12
5.4.300.0070.07719.03
5.4.290.0100.07319.13
5.4.280.0130.07718.88
5.4.270.0030.04018.94
5.4.260.0100.07319.03
5.4.250.0000.08019.11
5.4.240.0170.06719.02
5.4.230.0070.07719.12
5.4.220.0100.07018.86
5.4.210.0070.06719.03
5.4.200.0070.05719.25
5.4.190.0130.05319.21
5.4.180.0100.07019.08
5.4.170.0100.07319.12
5.4.160.0070.07319.11
5.4.150.0100.07018.86
5.4.140.0130.07016.37
5.4.130.0070.04316.35
5.4.120.0100.06716.34
5.4.110.0100.06716.50
5.4.100.0030.08016.50
5.4.90.0070.07716.31
5.4.80.0030.07716.34
5.4.70.0070.07316.36
5.4.60.0070.06016.34
5.4.50.0130.05716.31
5.4.40.0070.04016.49
5.4.30.0100.07316.39
5.4.20.0230.04716.49
5.4.10.0200.05716.48
5.4.00.0100.07015.80
5.3.290.0100.07014.52
5.3.280.0000.08314.41
5.3.270.0030.08314.62
5.3.260.0130.07014.60
5.3.250.0130.06314.63
5.3.240.0070.07314.46
5.3.230.0030.04314.60
5.3.220.0070.07014.51
5.3.210.0070.07014.54
5.3.200.0030.08314.57
5.3.190.0100.04714.44
5.3.180.0070.05714.51
5.3.170.0100.06714.42
5.3.160.0030.05714.41
5.3.150.0130.07014.38
5.3.140.0070.07314.39
5.3.130.0100.07014.54
5.3.120.0070.04014.37
5.3.110.0100.05014.50
5.3.100.0170.06314.03
5.3.90.0170.06713.90
5.3.80.0000.07313.79
5.3.70.0100.07014.02
5.3.60.0070.06014.01
5.3.50.0030.07713.95
5.3.40.0100.07313.85
5.3.30.0130.06313.89
5.3.20.0070.06713.68
5.3.10.0130.07013.52
5.3.00.0070.04013.62
5.2.170.0070.06010.93
5.2.160.0030.04710.98
5.2.150.0100.05710.99
5.2.140.0030.06310.96
5.2.130.0070.05311.06
5.2.120.0070.06011.17
5.2.110.0030.06010.93
5.2.100.0070.04711.09
5.2.90.0000.03710.89
5.2.80.0070.06311.16
5.2.70.0030.06710.93
5.2.60.0030.06310.86
5.2.50.0000.06310.81
5.2.40.0030.05710.99
5.2.30.0070.06010.81
5.2.20.0030.03710.90
5.2.10.0000.04310.92
5.2.00.0070.04710.79
5.1.60.0100.04710.00
5.1.50.0070.05010.03
5.1.40.0030.0539.99
5.1.30.0070.05310.34
5.1.20.0070.05010.41
5.1.10.0000.03010.11
5.1.00.0070.04710.07
5.0.50.0070.0438.69
5.0.40.0030.0478.69
5.0.30.0130.0538.69
5.0.20.0030.0438.69
5.0.10.0030.0408.69
5.0.00.0030.0478.69
4.4.90.0030.0338.69
4.4.80.0000.0378.69
4.4.70.0000.0378.69
4.4.60.0030.0308.69
4.4.50.0030.0378.69
4.4.40.0000.0538.69
4.4.30.0000.0238.69
4.4.20.0000.0378.69
4.4.10.0030.0378.69
4.4.00.0070.0538.69
4.3.110.0030.0338.69
4.3.100.0000.0408.69
4.3.90.0000.0378.69
4.3.80.0030.0408.69
4.3.70.0030.0378.69
4.3.60.0030.0338.69
4.3.50.0130.0138.69
4.3.40.0030.0508.69
4.3.30.0000.0378.69
4.3.20.0000.0278.69
4.3.10.0000.0378.69
4.3.00.0000.0338.69

preferences:
46.21 ms | 401 KiB | 5 Q