3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = [1, 2, 3, 4, 5]; $vendors = ["Amazon", "Newegg", "Frys"]; function pc_permute($items, $perms = array()) { if (empty($items)) { //echo join(' ', $perms) . "</br>"; return $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); } } } var_dump(pc_permute(products));

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.00318.43
8.3.50.0070.01122.05
8.3.40.0150.00018.79
8.3.30.0110.00320.20
8.3.20.0030.00520.34
8.3.10.0080.00022.10
8.3.00.0080.00022.32
8.2.180.0110.01116.75
8.2.170.0070.01422.96
8.2.160.0030.01022.27
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00726.16
8.2.120.0040.00421.00
8.2.110.0100.00021.03
8.2.100.0100.00317.91
8.2.90.0030.00619.21
8.2.80.0060.00317.97
8.2.70.0060.00317.75
8.2.60.0030.00517.93
8.2.50.0000.00818.07
8.2.40.0040.00417.93
8.2.30.0000.00718.05
8.2.20.0070.00017.76
8.2.10.0070.00017.79
8.2.00.0080.00417.71
8.1.280.0090.00625.92
8.1.270.0050.00323.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0070.00418.95
8.1.220.0040.00417.79
8.1.210.0000.00918.77
8.1.200.0060.00317.13
8.1.190.0040.00417.13
8.1.180.0130.00018.10
8.1.170.0050.00318.57
8.1.160.0030.00518.75
8.1.150.0040.00418.57
8.1.140.0040.00417.45
8.1.130.0070.00017.82
8.1.120.0000.00717.45
8.1.110.0040.00417.46
8.1.100.0000.00817.51
8.1.90.0000.00717.48
8.1.80.0070.00017.41
8.1.70.0030.00317.42
8.1.60.0050.00317.60
8.1.50.0050.00317.53
8.1.40.0000.00717.38
8.1.30.0000.00817.61
8.1.20.0000.00817.60
8.1.10.0090.00017.56
8.1.00.0030.00617.35
8.0.300.0000.00718.77
8.0.290.0070.00016.75
8.0.280.0070.00018.38
8.0.270.0030.00317.29
8.0.260.0000.00616.80
8.0.250.0030.00317.01
8.0.240.0040.00417.07
8.0.230.0070.00017.02
8.0.220.0000.00716.90
8.0.210.0000.00716.90
8.0.200.0030.00316.96
8.0.190.0030.00516.98
8.0.180.0000.00717.02
8.0.170.0040.00416.86
8.0.160.0000.00716.81
8.0.150.0050.00316.94
8.0.140.0040.00416.86
8.0.130.0050.00013.38
8.0.120.0040.00416.95
8.0.110.0000.00816.83
8.0.100.0040.00316.94
8.0.90.0050.00316.91
8.0.80.0070.00716.96
8.0.70.0000.00716.91
8.0.60.0000.00816.94
8.0.50.0030.00616.88
8.0.30.0110.00717.09
8.0.20.0150.00417.40
8.0.10.0000.00717.13
8.0.00.0090.01116.78
7.4.330.0060.00315.43
7.4.320.0040.00417.63
7.4.300.0040.00417.39
7.4.290.0060.00317.32
7.4.280.0080.00017.47
7.4.270.0070.00017.80
7.4.260.0080.00717.76
7.4.250.0040.00417.54
7.4.240.0040.00417.52
7.4.230.0080.00018.05
7.4.220.0190.00618.75
7.4.210.0070.01218.09
7.4.200.0030.00517.18
7.4.190.0080.00017.69
7.4.160.0200.01020.88
7.4.150.0480.01721.00
7.4.140.0490.01720.93
7.4.130.0370.01420.92
7.4.120.0300.01520.91
7.4.110.0170.01017.25
7.4.100.0100.01017.62
7.4.90.0180.00618.23
7.4.80.0040.01719.39
7.4.70.0090.00917.73
7.4.60.0060.01617.29
7.4.50.0000.01017.98
7.4.40.0090.00622.77
7.4.30.0190.02020.96
7.4.00.0100.00715.57
7.3.330.0070.00014.54
7.3.320.0030.00314.26
7.3.310.0050.00217.11
7.3.300.0040.00417.37
7.3.290.0130.03920.70
7.3.280.0090.01217.87
7.3.270.0310.02720.88
7.3.260.0120.00917.65
7.3.250.0180.01619.38
7.3.240.0270.01820.78
7.3.230.0140.00717.48
7.3.210.0770.01120.77
7.3.200.0270.02520.84
7.3.190.0930.03920.66
7.3.180.0790.03121.02
7.3.170.0240.01620.89
7.3.160.0060.01819.60
7.3.120.0100.01017.21
7.2.330.0130.01319.50
7.2.320.0230.01320.15
7.2.310.0100.01017.56
7.2.300.0150.00317.62
7.2.290.0230.02021.03
7.2.60.0110.00718.90
7.2.00.0000.01219.06
7.1.200.0060.00919.75
7.1.70.0040.00421.15
7.1.60.0060.00921.46
7.1.50.0110.01421.18
7.0.200.0040.01522.49

preferences:
44.23 ms | 401 KiB | 5 Q