3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = [1, 2, 3, 4, 5]; $vendors = ["Amazon", "Newegg", "Frys"]; $product_combinations = array(); function pc_permute($items, &$combinations, $perms = array()) { if (empty($items)) { $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, $combinations, $newperms); } } } // Build product combinations pc_permute($products, $product_combinations); // Build vendor combinations var_dump($product_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.0130.00618.30
8.3.50.0100.01121.09
8.3.40.0200.00718.48
8.3.30.0090.00920.35
8.3.20.0100.00020.16
8.3.10.0000.00922.09
8.3.00.0030.00622.41
8.2.180.0100.01316.50
8.2.170.0100.00722.96
8.2.160.0070.01122.31
8.2.150.0100.00024.18
8.2.140.0100.00024.66
8.2.130.0070.00326.16
8.2.120.0100.00020.75
8.2.110.0040.00822.26
8.2.100.0150.00017.65
8.2.90.0000.00919.23
8.2.80.0030.00619.32
8.2.70.0030.00717.50
8.2.60.0040.00718.04
8.2.50.0060.00318.07
8.2.40.0000.00918.03
8.2.30.0060.00318.03
8.2.20.0060.00317.80
8.2.10.0030.00617.77
8.2.00.0070.00717.75
8.1.280.0120.00625.92
8.1.270.0030.00723.99
8.1.260.0100.00026.35
8.1.250.0030.00728.09
8.1.240.0030.00923.98
8.1.230.0130.00019.10
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0080.00417.35
8.1.190.0000.00917.40
8.1.180.0080.00418.10
8.1.170.0090.00018.42
8.1.160.0090.00018.94
8.1.150.0000.00918.66
8.1.140.0030.00617.50
8.1.130.0030.00517.88
8.1.120.0000.00817.52
8.1.110.0040.00417.49
8.1.100.0000.00817.57
8.1.90.0030.00617.54
8.1.80.0000.00817.52
8.1.70.0030.00517.33
8.1.60.0100.00017.68
8.1.50.0000.00917.60
8.1.40.0030.00617.47
8.1.30.0000.00917.64
8.1.20.0070.00317.66
8.1.10.0100.00017.52
8.1.00.0060.00317.52
8.0.300.0040.00418.77
8.0.290.0060.00317.15
8.0.280.0050.00318.36
8.0.270.0080.00017.12
8.0.260.0080.00016.80
8.0.250.0040.00416.96
8.0.240.0030.00616.95
8.0.230.0000.00916.90
8.0.220.0000.00816.95
8.0.210.0030.00516.79
8.0.200.0030.00616.83
8.0.190.0060.00316.97
8.0.180.0030.00616.89
8.0.170.0060.00316.89
8.0.160.0030.00616.95
8.0.150.0080.00016.87
8.0.140.0030.00716.88
8.0.130.0040.00413.30
8.0.120.0060.00316.93
8.0.110.0060.00316.94
8.0.100.0040.00416.92
8.0.90.0000.00916.77
8.0.80.0100.01016.90
8.0.70.0000.00816.84
8.0.60.0040.00416.90
8.0.50.0030.00516.77
8.0.30.0110.01616.93
8.0.20.0200.01017.44
8.0.10.0000.00817.06
8.0.00.0180.01316.56
7.4.330.0000.00815.05
7.4.320.0080.00016.66
7.4.300.0050.00216.66
7.4.290.0000.01116.48
7.4.280.0080.00016.55
7.4.270.0090.00016.53
7.4.260.0070.00413.33
7.4.250.0030.00616.64
7.4.240.0030.00616.58
7.4.230.0000.00816.68
7.4.220.0130.02716.43
7.4.210.0090.01216.58
7.4.200.0080.00016.55
7.4.190.0040.00416.72
7.4.160.0200.00716.36
7.4.150.0140.01017.40
7.4.140.0180.01517.86
7.4.130.0280.01716.62
7.4.120.0120.01516.52
7.4.110.0160.01016.54
7.4.100.0160.00916.58
7.4.90.0120.01916.66
7.4.80.0120.01619.39
7.4.70.0250.00916.54
7.4.60.0100.01416.43
7.4.50.0070.00416.42
7.4.40.0070.01322.77
7.4.30.0090.02516.51
7.4.00.0150.00815.15
7.3.330.0030.00313.43
7.3.320.0000.00613.21
7.3.310.0000.00816.30
7.3.300.0030.00516.41
7.3.290.0030.01616.38
7.3.280.0060.01416.35
7.3.270.0210.00617.40
7.3.260.0190.00916.79
7.3.250.0170.01416.64
7.3.240.0070.02016.63
7.3.230.0040.02216.43
7.3.210.0120.01516.39
7.3.200.0150.01219.39
7.3.190.0110.01816.45
7.3.180.0080.01616.48
7.3.170.0150.00916.38
7.3.160.0120.00916.48
7.3.120.0110.00814.95
7.2.330.0170.01016.74
7.2.320.0170.00816.75
7.2.310.0090.01516.89
7.2.300.0160.01616.59
7.2.290.0070.01516.94
7.2.60.0110.00817.01
7.2.50.0060.00917.07
7.2.00.0130.00619.33
7.1.200.0070.01115.93
7.1.100.0030.01317.87
7.1.70.0040.00717.38
7.1.60.0110.01819.32
7.1.50.0090.01616.79
7.1.00.0030.07022.52
7.0.200.0860.00314.69
7.0.140.0100.07322.21
7.0.100.0130.06719.95
7.0.90.0100.08319.99
7.0.80.0070.04019.88
7.0.70.0100.08719.91
7.0.60.0130.05319.95
7.0.50.0200.05320.32
7.0.40.0130.04020.14
7.0.30.0070.07320.13
7.0.20.0030.06719.92
7.0.10.0000.06020.10
7.0.00.0070.06720.14
5.6.280.0070.07321.12
5.6.250.0130.04720.67
5.6.240.0070.08720.75
5.6.230.0100.08720.64
5.6.220.0000.08320.63
5.6.210.0030.05320.50
5.6.200.0070.06021.18
5.6.190.0130.03721.10
5.6.180.0070.08721.10
5.6.170.0000.06321.04
5.6.160.0170.08321.08
5.6.150.0100.08021.21
5.6.140.0100.06721.15
5.6.130.0130.07021.05
5.6.120.0130.08021.21
5.6.110.0070.04321.08
5.6.100.0070.05721.00
5.6.90.0100.08721.14
5.6.80.0100.08020.42
5.6.70.0030.08020.46
5.6.60.0100.03720.49
5.6.50.0270.05720.51
5.6.40.0100.08320.41
5.6.30.0100.08020.53
5.6.20.0070.07320.46
5.6.10.0200.07320.48
5.6.00.0200.04720.42
5.5.380.0030.05320.41
5.5.370.0100.05720.49
5.5.360.0000.08720.45
5.5.350.0030.05320.41
5.5.340.0100.09020.82
5.5.330.0100.04020.95
5.5.320.0230.06720.96
5.5.310.0130.07720.82
5.5.300.0000.06020.95
5.5.290.0000.08720.82
5.5.280.0100.07720.93
5.5.270.0070.06020.89
5.5.260.0030.07020.82
5.5.250.0100.08720.68
5.5.240.0000.08020.29
5.5.230.0100.06720.21
5.5.220.0000.08020.16
5.5.210.0030.05320.32
5.5.200.0130.03320.26
5.5.190.0100.07720.19
5.5.180.0130.06020.13
5.5.160.0170.06320.23
5.5.150.0100.08020.25
5.5.140.0130.06020.21
5.5.130.0070.04020.18
5.5.120.0100.04320.29
5.5.110.0170.03720.25
5.5.100.0070.04720.14
5.5.90.0000.04320.10
5.5.80.0070.03720.10
5.5.70.0030.04020.09
5.5.60.0030.04020.19
5.5.50.0030.04019.97
5.5.40.0100.03319.97
5.5.30.0170.03320.13
5.5.20.0000.03720.19
5.5.10.0070.07320.08
5.5.00.0070.04320.02
5.4.450.0030.04319.42
5.4.440.0070.05719.36
5.4.430.0130.04019.28
5.4.420.0170.07319.17
5.4.410.0070.04719.43
5.4.400.0070.03319.21
5.4.390.0070.06719.04
5.4.380.0100.04018.85
5.4.370.0130.07319.23
5.4.360.0030.07719.05
5.4.350.0270.06719.04
5.4.340.0030.04319.16
5.4.320.0070.08719.04
5.4.310.0100.04319.14
5.4.300.0200.06719.04
5.4.290.0070.04019.23
5.4.280.0070.05319.04
5.4.270.0100.03718.94
5.4.260.0130.03019.23
5.4.250.0130.03719.04
5.4.240.0100.02719.12
5.4.230.0070.03719.03
5.4.220.0000.04319.13
5.4.210.0030.04018.84
5.4.200.0030.04019.04
5.4.190.0030.03319.18
5.4.180.0030.03318.89
5.4.170.0030.05319.11
5.4.160.0030.05018.83
5.4.150.0130.06719.07
5.4.140.0100.06316.52
5.4.130.0030.03716.46
5.4.120.0070.03316.45
5.4.110.0070.03716.54
5.4.100.0030.03716.53
5.4.90.0100.03016.56
5.4.80.0070.03316.55
5.4.70.0000.03316.55
5.4.60.0000.04016.39
5.4.50.0170.02716.39
5.4.40.0100.03716.38
5.4.30.0030.03016.41
5.4.20.0030.03316.45
5.4.10.0000.03716.30
5.4.00.0000.03315.83
5.3.290.0100.06314.65
5.3.280.0170.02714.45
5.3.270.0030.05714.56
5.3.260.0100.02714.61
5.3.250.0130.06014.44
5.3.240.0000.04014.56
5.3.230.0000.04014.46
5.3.220.0000.04314.56
5.3.210.0070.04314.43
5.3.200.0030.03714.42
5.3.190.0070.04014.56
5.3.180.0000.03314.52
5.3.170.0000.04314.55
5.3.160.0030.03014.43
5.3.150.0030.03714.39
5.3.140.0000.04014.53
5.3.130.0030.03714.41
5.3.120.0030.03714.54
5.3.110.0070.03314.52
5.3.100.0000.04013.90
5.3.90.0070.03313.88
5.3.80.0030.03013.79
5.3.70.0000.04313.98
5.3.60.0030.03013.98
5.3.50.0030.03313.85
5.3.40.0030.03013.92
5.3.30.0100.02713.66
5.3.20.0070.03713.64
5.3.10.0100.02313.65
5.3.00.0030.03713.39
5.2.170.0070.02312.15
5.2.160.0100.01712.15
5.2.150.0000.03012.15
5.2.140.0000.02712.15
5.2.130.0000.03312.15
5.2.120.0000.03012.15
5.2.110.0030.02312.15
5.2.100.0030.02312.15
5.2.90.0000.02712.15
5.2.80.0030.02712.15
5.2.70.0100.02712.15
5.2.60.0000.02712.15
5.2.50.0030.02712.15
5.2.40.0030.02712.15
5.2.30.0030.03012.15
5.2.20.0030.03012.15
5.2.10.0000.03012.15
5.2.00.0070.02012.15
5.1.60.0000.02012.15
5.1.50.0030.02012.15
5.1.40.0000.02012.15
5.1.30.0030.03012.15
5.1.20.0030.02012.15
5.1.10.0030.02012.15
5.1.00.0070.02012.15
5.0.50.0030.02012.15
5.0.40.0000.02712.15
5.0.30.0030.04712.15
5.0.20.0100.02012.15
5.0.10.0070.03712.15
5.0.00.0030.06312.15
4.4.90.0000.01312.15
4.4.80.0030.01312.15
4.4.70.0070.01012.15
4.4.60.0030.01312.15
4.4.50.0000.01312.15
4.4.40.0000.02012.15
4.4.30.0000.01312.15
4.4.20.0000.01312.15
4.4.10.0030.01312.15
4.4.00.0000.02012.15
4.3.110.0030.02012.15
4.3.100.0030.03312.15
4.3.90.0100.02712.15
4.3.80.0000.05012.15
4.3.70.0000.03312.15
4.3.60.0000.03312.15
4.3.50.0030.01312.15
4.3.40.0000.05312.15
4.3.30.0030.03712.15
4.3.20.0000.03312.15
4.3.10.0000.03012.15
4.3.00.0030.01712.15

preferences:
43.12 ms | 401 KiB | 5 Q