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; //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.40.0040.01118.67
8.3.30.0040.01120.32
8.3.20.0040.00420.33
8.3.10.0080.00022.13
8.3.00.0060.00322.34
8.2.170.0120.00922.96
8.2.160.0000.01522.13
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0090.00021.07
8.2.110.0030.00722.08
8.2.100.0090.00317.85
8.2.90.0090.00018.34
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0030.00518.04
8.2.50.0000.00818.10
8.2.40.0000.00818.18
8.2.30.0070.00018.13
8.2.20.0080.00017.85
8.2.10.0050.00317.82
8.2.00.0090.00017.66
8.1.270.0070.00023.99
8.1.260.0090.00026.35
8.1.250.0060.00328.09
8.1.240.0060.00324.00
8.1.230.0080.00321.04
8.1.220.0030.00517.78
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0040.00417.36
8.1.180.0040.00418.10
8.1.170.0040.00418.60
8.1.160.0030.00518.78
8.1.150.0040.00418.61
8.1.140.0000.00817.48
8.1.130.0000.00717.77
8.1.120.0030.00517.38
8.1.110.0040.00417.48
8.1.100.0040.00417.51
8.1.90.0040.00417.36
8.1.80.0020.00517.41
8.1.70.0000.00917.40
8.1.60.0000.00817.64
8.1.50.0040.00417.44
8.1.40.0000.00917.56
8.1.30.0000.00817.64
8.1.20.0000.00917.53
8.1.10.0030.00517.50
8.1.00.0030.00517.49
8.0.300.0070.00020.09
8.0.290.0000.00916.63
8.0.280.0040.00418.36
8.0.270.0000.00717.27
8.0.260.0030.00316.91
8.0.250.0070.00016.93
8.0.240.0060.00317.00
8.0.230.0040.00416.79
8.0.220.0040.00416.87
8.0.210.0050.00316.77
8.0.200.0000.00816.89
8.0.190.0030.00616.97
8.0.180.0080.00016.92
8.0.170.0000.00716.84
8.0.160.0080.00016.97
8.0.150.0030.00416.87
8.0.140.0000.00816.87
8.0.130.0000.00613.30
8.0.120.0040.00416.93
8.0.110.0000.00716.80
8.0.100.0040.00416.96
8.0.90.0040.00416.87
8.0.80.0180.00016.91
8.0.70.0050.00216.93
8.0.60.0030.00516.91
8.0.50.0040.00416.79
8.0.30.0160.00616.87
8.0.20.0100.00917.40
8.0.10.0060.00316.91
8.0.00.0090.00816.73
7.4.330.0030.00515.00
7.4.320.0000.00716.46
7.4.300.0060.00016.50
7.4.290.0090.00016.41
7.4.280.0000.00716.54
7.4.270.0000.00716.62
7.4.260.0000.00813.27
7.4.250.0070.00016.55
7.4.240.0040.00316.49
7.4.230.0000.00716.59
7.4.220.0130.00816.48
7.4.210.0080.00816.59
7.4.200.0050.00216.52
7.4.190.0000.00716.33
7.4.160.0120.00616.46
7.4.150.0130.01017.40
7.4.140.0110.01217.86
7.4.130.0120.00616.51
7.4.120.0100.01216.43
7.4.110.0130.00816.61
7.4.100.0090.01216.65
7.4.90.0090.01716.59
7.4.80.0100.00919.39
7.4.70.0100.00716.43
7.4.60.0070.01016.46
7.4.50.0000.00916.57
7.4.40.0000.01722.77
7.4.30.0100.00816.65
7.4.10.0100.01015.07
7.4.00.0100.00714.73
7.3.330.0000.00513.37
7.3.320.0030.00313.29
7.3.310.0040.00416.41
7.3.300.0000.00716.37
7.3.290.0140.00016.36
7.3.280.0020.01516.36
7.3.270.0100.01017.40
7.3.260.0090.00916.41
7.3.250.0120.00816.45
7.3.240.0170.00416.61
7.3.230.0120.00616.67
7.3.210.0030.01716.48
7.3.200.0060.01119.39
7.3.190.0130.01016.28
7.3.180.0040.01416.62
7.3.170.0150.00316.35
7.3.160.0120.00616.44
7.3.130.0100.00714.98
7.3.120.0070.01014.83
7.3.110.0100.00615.02
7.3.100.0040.01414.74
7.3.90.0060.00914.96
7.3.80.0060.00914.77
7.3.70.0030.01314.98
7.3.60.0040.00814.70
7.3.50.0000.01014.84
7.3.40.0000.01414.84
7.3.30.0130.00314.68
7.3.20.0030.01016.76
7.3.10.0050.00816.51
7.3.00.0070.00716.73
7.2.330.0110.00716.66
7.2.320.0130.00916.42
7.2.310.0090.01316.72
7.2.300.0050.01216.55
7.2.290.0130.00316.76
7.2.260.0100.00715.13
7.2.250.0030.01414.97
7.2.240.0080.00815.30
7.2.230.0040.01114.96
7.2.220.0000.02015.22
7.2.210.0070.00715.28
7.2.200.0060.00914.91
7.2.190.0000.01814.73
7.2.180.0040.01115.20
7.2.170.0100.00715.09
7.2.160.0060.00915.14
7.2.150.0100.00716.59
7.2.140.0060.00616.72
7.2.130.0080.00516.84
7.2.120.0050.00916.87
7.2.110.0050.00916.92
7.2.100.0090.00616.88
7.2.90.0070.00717.02
7.2.80.0030.00916.89
7.2.70.0060.00616.77
7.2.60.0060.00916.96
7.2.50.0080.00816.82
7.2.40.0030.01317.10
7.2.30.0040.01316.99
7.2.20.0090.00517.05
7.2.10.0000.01316.94
7.2.00.0090.00316.91
7.1.330.0080.00816.00
7.1.320.0030.01415.71
7.1.310.0030.01015.96
7.1.300.0070.01115.96
7.1.290.0030.01316.00
7.1.280.0090.00615.81
7.1.270.0100.00715.82
7.1.260.0030.01215.89
7.1.250.0040.01115.84
7.1.240.0090.00915.91
7.1.230.0070.01015.58
7.1.220.0060.00915.88
7.1.210.0070.01015.91
7.1.200.0060.00615.69
7.1.190.0000.01615.87
7.1.180.0040.01115.71
7.1.170.0050.00415.79
7.1.160.0090.00615.98
7.1.150.0070.00715.77
7.1.140.0030.00615.77
7.1.130.0060.00915.80
7.1.120.0070.00715.90
7.1.110.0080.00515.88
7.1.100.0030.01015.83
7.1.90.0030.01015.83
7.1.80.0040.00815.76
7.1.70.0090.00417.15
7.1.60.0070.01417.04
7.1.50.0080.00917.17
7.1.40.0050.00917.16
7.1.30.0080.00817.10
7.1.20.0060.00916.97
7.1.10.0120.00316.97
7.1.00.0060.00517.17
7.0.330.0070.01015.22
7.0.320.0070.00715.23
7.0.310.0030.01015.23
7.0.300.0030.00915.53
7.0.290.0090.00615.52
7.0.280.0110.00715.21
7.0.270.0040.01115.63
7.0.260.0100.00715.48
7.0.250.0030.01015.29
7.0.240.0150.00015.34
7.0.230.0070.00715.41
7.0.220.0040.01115.46
7.0.210.0100.00315.54
7.0.200.0060.00816.99
7.0.190.0070.00916.95
7.0.180.0080.00816.72
7.0.170.0040.00716.96
7.0.160.0080.00716.85
7.0.150.0090.00416.93
7.0.140.0060.00816.94
7.0.130.0080.00516.95
7.0.120.0060.00416.82
7.0.110.0060.00816.91
7.0.100.0050.00716.94
7.0.90.0080.00316.96
7.0.80.0070.00616.90
7.0.70.0070.00516.88
7.0.60.0070.00716.96
7.0.50.0060.00617.04
7.0.40.0090.00515.93
7.0.30.0020.01115.88
7.0.20.0050.00915.85
7.0.10.0090.00415.95
7.0.00.0050.00815.82
5.6.400.0130.00314.56
5.6.390.0030.00714.62
5.6.380.0040.01414.18
5.6.370.0100.00014.42
5.6.360.0000.01814.24
5.6.350.0100.01014.43
5.6.340.0100.00614.43
5.6.330.0070.00714.19
5.6.320.0030.00714.70
5.6.310.0060.00914.32
5.6.300.0120.02117.52
5.6.290.0060.02817.76
5.6.280.0070.02717.89
5.6.270.0100.02417.71
5.6.260.0090.03317.71
5.6.250.0100.02317.56
5.6.240.0080.02717.78
5.6.230.0080.03817.58
5.6.220.0060.02817.66
5.6.210.0130.01917.51
5.6.200.0050.02817.73
5.6.190.0020.03317.80
5.6.180.0060.02817.74
5.6.170.0090.02417.61
5.6.160.0040.02617.71
5.6.150.0120.02217.70
5.6.140.0030.03517.58
5.6.130.0080.02617.55
5.6.120.0050.03017.79
5.6.110.0200.02017.87
5.6.100.0030.03117.61
5.6.90.0070.02717.67
5.6.80.0090.02517.35
5.6.70.0070.03017.52
5.6.60.0090.02317.35
5.6.50.0060.02617.17
5.6.40.0080.02417.37
5.6.30.0070.02517.39
5.6.20.0110.02017.26
5.6.10.0070.02517.29
5.6.00.0080.02417.23
5.5.380.0030.02616.17
5.5.370.0100.02216.38
5.5.360.0060.02816.32
5.5.350.0050.02816.41
5.5.340.0090.02216.45
5.5.330.0070.02216.45
5.5.320.0080.02516.18
5.5.310.0030.02616.33
5.5.300.0100.02616.37
5.5.290.0050.02916.29
5.5.280.0070.02916.34
5.5.270.0050.02916.35
5.5.260.0080.02716.29
5.5.250.0190.02916.45
5.5.240.0070.02416.34
5.5.230.0110.02616.38
5.5.220.0020.02916.34
5.5.210.0120.02316.29
5.5.200.0050.02416.51
5.5.190.0050.02616.27
5.5.180.0100.02516.21
5.5.170.0060.00314.35
5.5.160.0030.02816.25
5.5.150.0070.02516.32
5.5.140.0060.02216.25
5.5.130.0030.02616.36
5.5.120.0110.01916.34
5.5.110.0110.01916.30
5.5.100.0050.02616.30
5.5.90.0210.02316.20
5.5.80.0050.02416.28
5.5.70.0100.02116.35
5.5.60.0050.02416.12
5.5.50.0050.02616.25
5.5.40.0020.02816.24
5.5.30.0060.02416.19
5.5.20.0060.02516.25
5.5.10.0110.02016.36
5.5.00.0060.02816.16
5.4.450.0080.02816.30
5.4.440.0170.02316.27
5.4.430.0050.02616.34
5.4.420.0050.02316.35
5.4.410.0050.02716.25
5.4.400.0020.03116.21
5.4.390.0000.03416.21
5.4.380.0070.03016.18
5.4.370.0050.02416.20
5.4.360.0040.02616.15
5.4.350.0110.02516.19
5.4.340.0010.02916.18
5.4.330.0070.00413.32
5.4.320.0050.02616.17
5.4.310.0070.02316.13
5.4.300.0050.02816.25
5.4.290.0060.02516.26
5.4.280.0050.02216.20
5.4.270.0060.02116.12
5.4.260.0050.02816.24
5.4.250.0070.01916.19
5.4.240.0080.02016.12
5.4.230.0030.02416.10
5.4.220.0090.02816.20
5.4.210.0070.02716.24
5.4.200.0050.02416.15
5.4.190.0080.02216.10
5.4.180.0070.02516.19
5.4.170.0070.02516.10
5.4.160.0080.02116.13
5.4.150.0040.02916.12
5.4.140.0050.04115.82
5.4.130.0030.02315.82
5.4.120.0050.02515.82
5.4.110.0000.02515.82
5.4.100.0050.02615.82
5.4.90.0110.01915.82
5.4.80.0060.02315.82
5.4.70.0020.02615.82
5.4.60.0040.02215.82
5.4.50.0060.02215.82
5.4.40.0060.02015.82
5.4.30.0040.01915.82
5.4.20.0030.02415.82
5.4.10.0050.02215.82
5.4.00.0080.01915.82
5.3.290.0030.03515.82
5.3.280.0000.02615.82
5.3.270.0100.01715.82
5.3.260.0080.01815.82
5.3.250.0070.03215.82
5.3.240.0030.02215.82
5.3.230.0020.02715.82
5.3.220.0050.02115.82
5.3.210.0060.02015.82
5.3.200.0030.02515.82
5.3.190.0050.02115.82
5.3.180.0050.02315.82
5.3.170.0050.02215.82
5.3.160.0040.02315.82
5.3.150.0050.02415.82
5.3.140.0030.02115.82
5.3.130.0030.02215.82
5.3.120.0030.02515.82
5.3.110.0060.02115.82
5.3.100.0010.02315.82
5.3.90.0020.02515.82
5.3.80.0040.02415.82
5.3.70.0080.01815.82
5.3.60.0050.02015.82
5.3.50.0040.02115.82
5.3.40.0060.02015.82
5.3.30.0080.01915.82
5.3.20.0090.01415.82
5.3.10.0020.02315.82
5.3.00.0060.01915.82
5.2.170.0040.03218.33
5.2.160.0130.02218.33
5.2.150.0070.02818.33
5.2.140.0030.03418.33
5.2.130.0030.03218.33
5.2.120.0000.04118.33
5.2.110.0060.02818.33
5.2.100.0070.02718.33
5.2.90.0030.03518.33
5.2.80.0030.03318.33
5.2.70.0040.02918.33
5.2.60.0060.02718.33
5.2.50.0030.03118.33
5.2.40.0060.02618.33
5.2.30.0000.03418.33
5.2.20.0000.03118.33
5.2.10.0000.03318.33
5.2.00.0000.03318.33
5.1.60.0090.02118.33
5.1.50.0050.02218.33
5.1.40.0070.02118.33
5.1.30.0000.03118.33
5.1.20.0040.02518.33
5.1.10.0100.02018.33
5.1.00.0030.03118.33
5.0.50.0030.02118.33
5.0.40.0060.02318.33
5.0.30.0030.02918.33
5.0.20.0000.02318.33
5.0.10.0030.02418.33
5.0.00.0040.02918.33
4.4.90.0000.01718.33
4.4.80.0030.01318.33
4.4.70.0060.01218.33
4.4.60.0060.01318.33
4.4.50.0070.01718.33
4.4.40.0000.02618.33
4.4.30.0000.01718.33
4.4.20.0000.01818.33
4.4.10.0180.01518.33
4.4.00.0000.02918.33
4.3.110.0030.01418.33
4.3.100.0000.02218.33
4.3.90.0000.01918.33
4.3.80.0030.02418.33
4.3.70.0000.01718.33
4.3.60.0000.01718.33
4.3.50.0040.01518.33
4.3.40.0000.02718.33
4.3.30.0000.01818.33
4.3.20.0100.01018.33
4.3.10.0000.02318.33
4.3.00.0000.01618.33

preferences:
46.51 ms | 400 KiB | 5 Q