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); //return $perms; var_dump($perms); //$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.0110.01418.30
8.3.50.0180.00521.93
8.3.40.0070.02018.52
8.3.30.0160.00320.35
8.3.20.0000.01020.20
8.3.10.0060.00322.05
8.3.00.0070.00322.52
8.2.180.0160.01018.29
8.2.170.0150.00322.96
8.2.160.0180.00022.13
8.2.150.0060.00324.18
8.2.140.0060.00324.66
8.2.130.0110.00726.16
8.2.120.0000.01021.07
8.2.110.0040.00722.07
8.2.100.0070.01217.59
8.2.90.0030.00619.22
8.2.80.0070.00317.97
8.2.70.0100.00017.50
8.2.60.0000.00917.93
8.2.50.0050.00518.07
8.2.40.0030.00618.34
8.2.30.0040.00718.22
8.2.20.0030.00617.77
8.2.10.0000.00917.71
8.2.00.0000.01117.62
8.1.280.0030.01325.92
8.1.270.0070.00323.99
8.1.260.0030.00726.35
8.1.250.0090.00028.09
8.1.240.0110.00023.91
8.1.230.0100.00318.99
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0080.00317.23
8.1.190.0030.00617.13
8.1.180.0060.00318.10
8.1.170.0090.00018.65
8.1.160.0000.00921.95
8.1.150.0030.00718.56
8.1.140.0000.00917.45
8.1.130.0030.00517.83
8.1.120.0050.00317.36
8.1.110.0000.00917.48
8.1.100.0060.00317.45
8.1.90.0080.00317.44
8.1.80.0050.00317.36
8.1.70.0030.00617.35
8.1.60.0030.00817.46
8.1.50.0000.00817.49
8.1.40.0030.00617.42
8.1.30.0090.00017.46
8.1.20.0070.00317.54
8.1.10.0030.00717.55
8.1.00.0030.00617.42
8.0.300.0040.00418.77
8.0.290.0000.01016.63
8.0.280.0000.00818.48
8.0.270.0040.00417.26
8.0.260.0040.00416.72
8.0.250.0040.00416.85
8.0.240.0000.01016.93
8.0.230.0040.00416.82
8.0.220.0040.00416.80
8.0.210.0090.00016.84
8.0.200.0000.00816.88
8.0.190.0060.00316.80
8.0.180.0060.00316.87
8.0.170.0000.00916.88
8.0.160.0000.00816.89
8.0.150.0030.00616.82
8.0.140.0030.00616.87
8.0.130.0030.00313.30
8.0.120.0070.00316.87
8.0.110.0060.00316.90
8.0.100.0050.00516.75
8.0.90.0080.00016.95
8.0.80.0110.01416.84
8.0.70.0030.00516.79
8.0.60.0030.00716.78
8.0.50.0050.00316.85
8.0.30.0170.01816.92
8.0.20.0170.01217.40
8.0.10.0030.00617.00
8.0.00.0180.01416.92
7.4.330.0090.00015.07
7.4.320.0000.00816.39
7.4.300.0040.00416.51
7.4.290.0040.00416.40
7.4.280.0000.00916.48
7.4.270.0000.00816.51
7.4.260.0030.00613.23
7.4.250.0030.00616.54
7.4.240.0020.00616.48
7.4.230.0000.00816.34
7.4.220.0210.00916.64
7.4.210.0070.01416.59
7.4.200.0000.00816.39
7.4.190.0080.00016.45
7.4.160.0050.01816.68
7.4.150.0160.01217.40
7.4.140.0170.01417.86
7.4.130.0110.01916.39
7.4.120.0150.01816.62
7.4.110.0160.00916.41
7.4.100.0100.01616.40
7.4.90.0160.01516.47
7.4.80.0120.01819.39
7.4.70.0130.00916.49
7.4.60.0140.00716.30
7.4.50.0030.00616.63
7.4.40.0100.01022.77
7.4.30.0190.00916.59
7.4.00.0020.01714.86
7.3.330.0000.00613.23
7.3.320.0000.00613.23
7.3.310.0000.00916.35
7.3.300.0080.00016.37
7.3.290.0070.01116.38
7.3.280.0080.01416.35
7.3.270.0170.01117.40
7.3.260.0130.01616.27
7.3.250.0190.01316.40
7.3.240.0190.00816.27
7.3.230.0130.01316.41
7.3.210.0160.01316.47
7.3.200.0180.00919.39
7.3.190.0200.00716.38
7.3.180.0160.00716.42
7.3.170.0160.01216.32
7.3.160.0030.01916.42
7.3.120.0080.01114.98
7.3.110.0060.00914.68
7.3.100.0070.01715.01
7.3.90.0040.01114.63
7.3.80.0030.01914.81
7.3.70.0080.00814.75
7.3.60.0100.00714.92
7.3.50.0070.01014.83
7.3.40.0060.00614.66
7.3.30.0110.01414.96
7.3.20.0070.01716.70
7.3.10.0070.01116.80
7.3.00.0060.00616.64
7.2.330.0170.00916.78
7.2.320.0140.01916.54
7.2.310.0150.01216.48
7.2.300.0130.01016.43
7.2.290.0100.01316.72
7.2.250.0030.02014.60
7.2.240.0130.01015.27
7.2.230.0060.01314.86
7.2.220.0040.01415.08
7.2.210.0070.01115.16
7.2.200.0140.00315.11
7.2.190.0110.00715.16
7.2.180.0110.00414.72
7.2.170.0030.01415.13
7.1.330.0080.00815.65
7.1.320.0130.00715.99
7.1.310.0040.01515.67
7.1.300.0130.01015.92
7.1.290.0110.00716.02
7.1.280.0120.00915.98
7.1.270.0070.01016.01
7.1.260.0120.00315.67
7.1.200.0060.01015.77
7.1.70.0030.00617.22
7.1.60.0130.00619.32
7.1.50.0100.01717.04
7.1.00.0100.03022.24
7.0.200.0030.01016.48
7.0.140.0070.07322.13
7.0.100.0230.07320.11
7.0.90.0100.08719.93
7.0.80.0100.08019.90
7.0.70.0230.06719.92
7.0.60.0170.08019.92
7.0.50.0200.08320.34
7.0.40.0130.08020.04
7.0.30.0200.05319.95
7.0.20.0100.09020.10
7.0.10.0130.06719.94
7.0.00.0070.05720.21
5.6.280.0000.07721.11
5.6.250.0170.03720.54
5.6.240.0100.06320.71
5.6.230.0170.07320.64
5.6.220.0070.08320.54
5.6.210.0100.07020.63
5.6.200.0200.06721.06
5.6.190.0170.05321.07
5.6.180.0070.07020.93
5.6.170.0070.09021.01
5.6.160.0230.07020.95
5.6.150.0070.06020.93
5.6.140.0070.04720.96
5.6.130.0070.09021.07
5.6.120.0070.05321.02
5.6.110.0200.07320.97
5.6.100.0100.07021.06
5.6.90.0070.06720.91
5.6.80.0070.07020.33
5.6.70.0070.03320.43
5.6.60.0030.07320.39
5.6.50.0130.07320.52
5.6.40.0170.07720.44
5.6.30.0070.04320.44
5.6.20.0100.04320.41
5.6.10.0100.04020.40
5.6.00.0130.08020.42
5.5.380.0130.07720.32
5.5.370.0100.06720.30
5.5.360.0130.08020.37
5.5.350.0170.06720.38
5.5.340.0170.08320.92
5.5.330.0130.07020.81
5.5.320.0270.06720.81
5.5.310.0030.05320.91
5.5.300.0000.08720.86
5.5.290.0030.09020.82
5.5.280.0130.06720.79
5.5.270.0230.07720.85
5.5.260.0070.05020.88
5.5.250.0030.08320.61
5.5.240.0070.08020.22
5.5.230.0100.07320.27
5.5.220.0130.07320.14
5.5.210.0130.06020.27
5.5.200.0100.05320.12
5.5.190.0100.08320.12
5.5.180.0070.05320.18
5.5.160.0100.08320.11
5.5.150.0000.05720.18
5.5.140.0100.05720.23
5.5.130.0070.04720.28
5.5.120.0130.06320.07
5.5.110.0100.04020.10
5.5.100.0100.04020.09
5.5.90.0070.06720.16
5.5.80.0130.05720.06
5.5.70.0170.06320.06
5.5.60.0200.03320.05
5.5.50.0130.04320.03
5.5.40.0170.04019.93
5.5.30.0030.07319.93
5.5.20.0070.05720.15
5.5.10.0130.07020.05
5.5.00.0070.04020.17
5.4.450.0100.07319.54
5.4.440.0130.08019.18
5.4.430.0100.07019.20
5.4.420.0170.07319.44
5.4.410.0030.08719.14
5.4.400.0070.08019.14
5.4.390.0100.06318.88
5.4.380.0070.07319.15
5.4.370.0070.06018.88
5.4.360.0070.05019.03
5.4.350.0130.06319.03
5.4.340.0030.04018.88
5.4.320.0030.06719.13
5.4.310.0100.06719.09
5.4.300.0100.08018.84
5.4.290.0100.07719.18
5.4.280.0230.06319.18
5.4.270.0030.08319.18
5.4.260.0230.06718.87
5.4.250.0100.04719.04
5.4.240.0100.06019.02
5.4.230.0100.08018.84
5.4.220.0070.06319.12
5.4.210.0130.07318.89
5.4.200.0100.04718.90
5.4.190.0070.07319.08
5.4.180.0070.04319.02
5.4.170.0100.07318.86
5.4.160.0130.06719.11
5.4.150.0170.06719.14
5.4.140.0070.05316.41
5.4.130.0100.05316.38
5.4.120.0130.07316.36
5.4.110.0130.05016.45
5.4.100.0030.07316.37
5.4.90.0100.04716.36
5.4.80.0030.07716.38
5.4.70.0030.06316.44
5.4.60.0000.08016.50
5.4.50.0130.07016.29
5.4.40.0070.07716.49
5.4.30.0070.08016.43
5.4.20.0100.04016.41
5.4.10.0100.03716.40
5.4.00.0030.03315.81
5.3.290.0100.07314.62
5.3.280.0100.07314.54
5.3.270.0030.04714.59
5.3.260.0070.03714.46
5.3.250.0070.06314.44
5.3.240.0100.06714.46
5.3.230.0100.03714.45
5.3.220.0070.05714.56
5.3.210.0030.06714.50
5.3.200.0070.04014.51
5.3.190.0000.05014.54
5.3.180.0070.07014.48
5.3.170.0100.06714.55
5.3.160.0100.07314.54
5.3.150.0100.07014.38
5.3.140.0000.04314.56
5.3.130.0070.06314.37
5.3.120.0130.06314.48
5.3.110.0070.03314.54
5.3.100.0030.06714.05
5.3.90.0000.07713.93
5.3.80.0030.04013.96
5.3.70.0030.04014.01
5.3.60.0100.04013.86
5.3.50.0030.03313.93
5.3.40.0070.06713.71
5.3.30.0070.06713.91
5.3.20.0030.04013.66
5.3.10.0170.05713.62
5.3.00.0000.05313.59
5.2.170.0000.03712.40
5.2.160.0000.05712.40
5.2.150.0000.06012.40
5.2.140.0070.05712.40
5.2.130.0030.04012.40
5.2.120.0070.06012.40
5.2.110.0030.06312.40
5.2.100.0100.04712.40
5.2.90.0070.06312.40
5.2.80.0030.04712.40
5.2.70.0130.04712.40
5.2.60.0100.05712.40
5.2.50.0070.05312.40
5.2.40.0000.05012.40
5.2.30.0070.03312.40
5.2.20.0070.06012.40
5.2.10.0000.05712.40
5.2.00.0030.05312.40
5.1.60.0100.04712.40
5.1.50.0070.02712.40
5.1.40.0070.03012.40
5.1.30.0070.02312.40
5.1.20.0030.05312.40
5.1.10.0030.05012.40
5.1.00.0030.04312.40
5.0.50.0000.02712.40
5.0.40.0000.03312.40
5.0.30.0070.04712.40
5.0.20.0030.04312.40
5.0.10.0070.04012.40
5.0.00.0030.05012.40
4.4.90.0030.02712.40
4.4.80.0030.01712.40
4.4.70.0030.03712.40
4.4.60.0000.02312.40
4.4.50.0070.03012.40
4.4.40.0000.03012.40
4.4.30.0100.02712.40
4.4.20.0030.03012.40
4.4.10.0030.03712.40
4.4.00.0030.02312.40
4.3.110.0030.03012.40
4.3.100.0070.02712.40
4.3.90.0030.03312.40
4.3.80.0030.05712.40
4.3.70.0000.03012.40
4.3.60.0100.02712.40
4.3.50.0030.01712.40
4.3.40.0100.04012.40
4.3.30.0030.03312.40
4.3.20.0070.03312.40
4.3.10.0030.03312.40
4.3.00.0000.03312.40

preferences:
41.47 ms | 401 KiB | 5 Q