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 pc_permute($vendors, $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.0140.00718.55
8.3.50.0090.00722.11
8.3.40.0150.00018.57
8.3.30.0140.00020.21
8.3.20.0040.00420.25
8.3.10.0000.00822.09
8.3.00.0080.00022.31
8.2.180.0140.00716.63
8.2.170.0140.00722.96
8.2.160.0070.00722.20
8.2.150.0050.00224.18
8.2.140.0000.00724.66
8.2.130.0000.00726.16
8.2.120.0070.00021.03
8.2.110.0090.00022.19
8.2.100.0060.00617.78
8.2.90.0040.00419.05
8.2.80.0060.00319.26
8.2.70.0000.00917.63
8.2.60.0050.00317.80
8.2.50.0040.00418.07
8.2.40.0030.00618.18
8.2.30.0040.00418.11
8.2.20.0000.00717.71
8.2.10.0050.00217.68
8.2.00.0030.00717.67
8.1.280.0030.01325.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00023.71
8.1.230.0070.00419.16
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0070.00317.23
8.1.190.0050.00317.40
8.1.180.0030.00818.10
8.1.170.0040.00418.52
8.1.160.0040.00418.80
8.1.150.0050.00318.64
8.1.140.0040.00417.50
8.1.130.0000.00717.77
8.1.120.0000.00717.44
8.1.110.0040.00417.48
8.1.100.0000.00717.35
8.1.90.0000.00717.44
8.1.80.0020.00517.48
8.1.70.0040.00417.47
8.1.60.0000.00817.58
8.1.50.0040.00417.41
8.1.40.0040.00417.38
8.1.30.0050.00317.62
8.1.20.0000.00917.67
8.1.10.0000.00717.44
8.1.00.0020.00517.48
8.0.300.0040.00418.77
8.0.290.0030.00316.93
8.0.280.0070.00018.38
8.0.270.0040.00417.11
8.0.260.0000.00716.75
8.0.250.0000.00716.80
8.0.240.0090.00016.82
8.0.230.0040.00416.77
8.0.220.0030.00316.88
8.0.210.0000.00716.79
8.0.200.0040.00416.84
8.0.190.0040.00416.96
8.0.180.0040.00416.86
8.0.170.0000.00716.93
8.0.160.0040.00416.94
8.0.150.0040.00416.83
8.0.140.0040.00416.88
8.0.130.0030.00313.32
8.0.120.0030.00516.75
8.0.110.0070.00016.74
8.0.100.0000.00716.67
8.0.90.0000.00716.80
8.0.80.0080.00816.82
8.0.70.0000.00716.77
8.0.60.0040.00416.79
8.0.50.0040.00416.93
8.0.30.0130.00617.28
8.0.20.0100.00917.40
8.0.10.0050.00317.01
8.0.00.0070.01216.63
7.4.330.0000.00715.00
7.4.320.0000.00616.51
7.4.300.0030.00316.50
7.4.290.0020.00516.48
7.4.280.0030.00316.49
7.4.270.0030.00316.42
7.4.260.0070.00013.18
7.4.250.0000.00716.54
7.4.240.0000.00716.47
7.4.230.0000.00716.25
7.4.220.0130.00616.44
7.4.210.0090.00516.56
7.4.200.0030.00316.57
7.4.190.0030.00416.75
7.4.160.0120.00816.62
7.4.150.0070.01317.40
7.4.140.0110.01217.86
7.4.130.0110.00516.59
7.4.120.0080.01016.44
7.4.110.0100.00616.52
7.4.100.0120.00616.44
7.4.90.0100.01016.40
7.4.80.0100.01019.39
7.4.70.0110.00616.28
7.4.60.0100.00616.57
7.4.50.0000.00816.49
7.4.40.0070.01022.77
7.4.30.0040.01416.76
7.4.00.0070.01015.07
7.3.330.0000.00613.21
7.3.320.0060.00013.16
7.3.310.0030.00316.40
7.3.300.0070.00016.36
7.3.290.0060.01416.36
7.3.280.0090.00816.36
7.3.270.0170.00617.40
7.3.260.0080.00916.34
7.3.250.0150.00716.59
7.3.240.0100.00616.34
7.3.230.0050.01116.53
7.3.210.0100.00716.35
7.3.200.0180.01819.39
7.3.190.0070.01716.40
7.3.180.0100.00616.52
7.3.170.0120.00416.64
7.3.160.0130.00316.29
7.3.120.0070.00714.75
7.2.330.0090.00916.70
7.2.320.0160.00716.84
7.2.310.0120.00916.85
7.2.300.0160.00316.75
7.2.290.0060.00916.85
7.2.60.0070.00716.83
7.2.50.0090.00316.97
7.1.200.0040.00415.84
7.1.70.0000.01617.34
7.1.60.0070.01819.32
7.1.50.0070.01417.04
7.1.00.0070.07322.45
7.0.200.0040.00416.78
7.0.140.0000.07722.23
7.0.100.0300.04319.95
7.0.90.0030.08320.04
7.0.80.0130.04319.95
7.0.70.0070.05320.01
7.0.60.0070.06319.92
7.0.50.0070.07320.40
7.0.40.0030.08320.05
7.0.30.0130.05020.11
7.0.20.0000.08319.95
7.0.10.0030.06719.98
7.0.00.0070.05720.14
5.6.280.0000.07721.00
5.6.250.0100.07320.68
5.6.240.0000.05720.61
5.6.230.0100.08320.58
5.6.220.0130.07320.49
5.6.210.0100.08020.75
5.6.200.0100.04721.02
5.6.190.0170.07020.93
5.6.180.0170.08021.13
5.6.170.0070.09021.13
5.6.160.0170.06021.02
5.6.150.0030.05021.07
5.6.140.0200.09320.95
5.6.130.0170.07320.93
5.6.120.0100.04720.96
5.6.110.0070.08721.10
5.6.100.0130.08320.95
5.6.90.0100.07721.12
5.6.80.0100.07720.35
5.6.70.0070.07320.37
5.6.60.0070.07020.45
5.6.50.0170.07720.44
5.6.40.0170.06720.32
5.6.30.0170.06720.30
5.6.20.0130.07020.46
5.6.10.0070.07320.38
5.6.00.0070.08320.28
5.5.380.0100.07720.41
5.5.370.0100.04320.57
5.5.360.0000.10020.45
5.5.350.0100.07720.33
5.5.340.0130.06020.88
5.5.330.0130.07720.88
5.5.320.0070.06020.81
5.5.310.0030.08020.89
5.5.300.0100.07720.89
5.5.290.0070.07020.92
5.5.280.0100.08720.63
5.5.270.0100.09020.92
5.5.260.0070.06720.64
5.5.250.0100.08020.62
5.5.240.0100.07720.27
5.5.230.0070.07720.14
5.5.220.0030.08020.14
5.5.210.0070.07720.11
5.5.200.0070.06020.27
5.5.190.0070.08020.09
5.5.180.0030.08320.13
5.5.160.0200.05320.22
5.5.150.0170.03020.08
5.5.140.0000.04320.19
5.5.130.0070.03320.26
5.5.120.0030.04020.26
5.5.110.0070.03320.12
5.5.100.0030.03720.14
5.5.90.0000.04020.07
5.5.80.0030.04020.15
5.5.70.0070.03720.09
5.5.60.0070.03320.04
5.5.50.0070.03320.04
5.5.40.0100.03019.96
5.5.30.0070.07020.05
5.5.20.0100.06720.13
5.5.10.0100.07720.10
5.5.00.0000.08720.00
5.4.450.0030.09019.18
5.4.440.0170.07319.56
5.4.430.0070.06719.16
5.4.420.0030.07019.23
5.4.410.0030.08319.32
5.4.400.0130.03718.85
5.4.390.0070.07719.24
5.4.380.0070.07319.05
5.4.370.0100.06718.96
5.4.360.0100.07719.16
5.4.350.0070.07319.04
5.4.340.0000.07318.85
5.4.320.0130.08019.05
5.4.310.0000.07019.23
5.4.300.0070.03319.04
5.4.290.0030.03719.10
5.4.280.0100.03319.03
5.4.270.0070.03718.87
5.4.260.0000.04019.04
5.4.250.0030.03719.22
5.4.240.0030.03718.84
5.4.230.0000.04319.02
5.4.220.0070.06019.02
5.4.210.0000.03718.94
5.4.200.0070.03019.23
5.4.190.0070.07318.90
5.4.180.0070.04019.15
5.4.170.0000.03719.17
5.4.160.0070.04319.19
5.4.150.0070.07318.93
5.4.140.0030.03716.26
5.4.130.0030.03716.38
5.4.120.0070.03316.34
5.4.110.0030.03716.27
5.4.100.0100.03016.39
5.4.90.0070.03016.50
5.4.80.0030.03316.38
5.4.70.0070.03316.40
5.4.60.0100.03016.41
5.4.50.0100.03316.36
5.4.40.0000.04016.50
5.4.30.0000.03316.46
5.4.20.0000.03716.43
5.4.10.0100.04316.33
5.4.00.0000.03715.82
5.3.290.0100.07314.52
5.3.280.0100.02714.46
5.3.270.0000.07314.60
5.3.260.0000.07014.56
5.3.250.0000.04014.55
5.3.240.0070.04714.56
5.3.230.0000.05714.59
5.3.220.0070.03314.43
5.3.210.0070.03014.42
5.3.200.0070.04314.42
5.3.190.0070.03014.55
5.3.180.0030.04014.56
5.3.170.0000.04014.54
5.3.160.0030.03714.55
5.3.150.0070.03314.52
5.3.140.0070.03314.55
5.3.130.0100.04014.46
5.3.120.0000.03714.54
5.3.110.0030.03714.53
5.3.100.0100.03014.05
5.3.90.0070.03013.88
5.3.80.0030.04313.96
5.3.70.0030.04714.00
5.3.60.0000.04713.99
5.3.50.0000.03713.85
5.3.40.0030.03713.79
5.3.30.0070.03313.78
5.3.20.0130.02013.65
5.3.10.0000.03313.51
5.3.00.0030.03713.63
5.2.170.0000.03711.52
5.2.160.0000.02711.52
5.2.150.0030.02311.52
5.2.140.0070.02311.52
5.2.130.0030.02711.52
5.2.120.0070.02311.52
5.2.110.0000.03011.52
5.2.100.0070.02711.52
5.2.90.0030.02711.52
5.2.80.0030.03011.52
5.2.70.0000.03711.52
5.2.60.0030.05711.52
5.2.50.0030.06311.52
5.2.40.0030.04711.52
5.2.30.0070.05011.52
5.2.20.0070.05711.52
5.2.10.0030.04711.52
5.2.00.0000.05011.52
5.1.60.0030.05311.52
5.1.50.0100.05011.52
5.1.40.0030.05011.52
5.1.30.0030.03711.52
5.1.20.0000.05711.52
5.1.10.0100.04311.52
5.1.00.0070.04711.52
5.0.50.0070.03711.52
5.0.40.0000.04711.52
5.0.30.0030.06311.52
5.0.20.0070.04011.52
5.0.10.0030.04711.52
5.0.00.0030.04011.52
4.4.90.0000.02711.52
4.4.80.0100.02711.52
4.4.70.0070.03011.52
4.4.60.0030.01711.52
4.4.50.0000.03011.52
4.4.40.0100.04711.52
4.4.30.0030.03711.52
4.4.20.0070.01711.52
4.4.10.0000.02311.52
4.4.00.0070.05311.52
4.3.110.0100.03711.52
4.3.100.0070.03011.52
4.3.90.0100.02311.52
4.3.80.0000.05711.52
4.3.70.0000.02011.52
4.3.60.0100.01711.52
4.3.50.0070.03011.52
4.3.40.0000.06011.52
4.3.30.0000.03711.52
4.3.20.0000.03011.52
4.3.10.0000.03311.52
4.3.00.0030.03311.52

preferences:
54.09 ms | 400 KiB | 5 Q