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); //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.0120.00618.56
8.3.50.0100.01021.96
8.3.40.0040.01218.63
8.3.30.0060.00819.21
8.3.20.0120.00420.34
8.3.10.0060.00322.00
8.3.00.0040.00422.57
8.2.180.0100.01016.38
8.2.170.0130.00322.96
8.2.160.0120.00320.77
8.2.150.0080.00024.18
8.2.140.0080.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00419.23
8.2.110.0000.00922.13
8.2.100.0110.00417.57
8.2.90.0000.00819.18
8.2.80.0030.00519.66
8.2.70.0030.00617.63
8.2.60.0050.00318.03
8.2.50.0030.00618.07
8.2.40.0000.00818.09
8.2.30.0000.00718.00
8.2.20.0030.00517.71
8.2.10.0070.00017.69
8.2.00.0090.00017.73
8.1.280.0110.00425.92
8.1.270.0070.00022.05
8.1.260.0100.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.83
8.1.230.0110.00019.15
8.1.220.0080.00017.79
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0080.00017.66
8.1.180.0030.00618.10
8.1.170.0050.00318.64
8.1.160.0040.00421.93
8.1.150.0000.00818.71
8.1.140.0060.00317.40
8.1.130.0000.00717.77
8.1.120.0040.00417.37
8.1.110.0080.00017.44
8.1.100.0040.00417.34
8.1.90.0000.00817.38
8.1.80.0000.00717.37
8.1.70.0000.00717.41
8.1.60.0000.00817.49
8.1.50.0000.00717.42
8.1.40.0090.00017.57
8.1.30.0000.00817.70
8.1.20.0080.00017.61
8.1.10.0040.00417.48
8.1.00.0030.00517.53
8.0.300.0000.00718.77
8.0.290.0040.00417.05
8.0.280.0040.00418.44
8.0.270.0000.00717.18
8.0.260.0050.00316.81
8.0.250.0000.00716.80
8.0.240.0000.00716.94
8.0.230.0000.00816.82
8.0.220.0000.00716.86
8.0.210.0030.00316.73
8.0.200.0060.00016.91
8.0.190.0000.00816.82
8.0.180.0000.00716.86
8.0.170.0040.00416.89
8.0.160.0030.00516.74
8.0.150.0030.00416.82
8.0.140.0000.00816.79
8.0.130.0000.00513.35
8.0.120.0030.00616.80
8.0.110.0000.00716.89
8.0.100.0000.00717.01
8.0.90.0000.00816.84
8.0.80.0140.00016.88
8.0.70.0040.00416.77
8.0.60.0040.00416.79
8.0.50.0040.00416.96
8.0.30.0150.00916.96
8.0.20.0070.01617.40
8.0.10.0000.00716.89
8.0.00.0130.00516.65
7.4.330.0050.00215.15
7.4.320.0000.00616.66
7.4.300.0000.00616.65
7.4.290.0030.00616.44
7.4.280.0030.00316.51
7.4.270.0030.00316.63
7.4.260.0030.00316.51
7.4.250.0030.00316.50
7.4.240.0040.00316.49
7.4.230.0080.00016.64
7.4.220.0090.00916.54
7.4.210.0110.00616.58
7.4.200.0000.00716.63
7.4.190.0040.00416.48
7.4.160.0190.00016.46
7.4.150.0130.00717.40
7.4.140.0100.01117.86
7.4.130.0090.00816.41
7.4.120.0120.00516.52
7.4.110.0130.00616.50
7.4.100.0120.00916.54
7.4.90.0090.00916.55
7.4.80.0070.01119.39
7.4.70.0090.00916.52
7.4.60.0030.01316.47
7.4.50.0030.00616.19
7.4.40.0060.01022.77
7.4.30.0060.00916.32
7.4.10.0100.00914.85
7.4.00.0100.00815.00
7.3.330.0000.00513.34
7.3.320.0050.00013.21
7.3.310.0000.00716.42
7.3.300.0070.00016.22
7.3.290.0060.00916.30
7.3.280.0090.00916.36
7.3.270.0040.01317.40
7.3.260.0120.00616.58
7.3.250.0090.01116.57
7.3.240.0030.01416.60
7.3.230.0100.00716.43
7.3.210.0060.01216.62
7.3.200.0120.00919.39
7.3.190.0070.01016.33
7.3.180.0080.01616.48
7.3.170.0060.00916.43
7.3.160.0090.00616.38
7.3.130.0070.01114.93
7.3.120.0070.00914.83
7.3.110.0120.00614.93
7.3.100.0060.00714.85
7.3.90.0050.01114.69
7.3.80.0050.01114.89
7.3.70.0090.00514.62
7.3.60.0040.00714.81
7.3.50.0000.01214.64
7.3.40.0100.00314.68
7.3.30.0060.00614.83
7.3.20.0090.00516.63
7.3.10.0070.00616.74
7.3.00.0090.00716.67
7.2.330.0080.00916.60
7.2.320.0090.00916.84
7.2.310.0060.01016.64
7.2.300.0090.00916.64
7.2.290.0070.01016.82
7.2.260.0030.01514.86
7.2.250.0080.01014.99
7.2.240.0030.01115.13
7.2.230.0080.00815.26
7.2.220.0070.01015.25
7.2.210.0050.00515.22
7.2.200.0100.00514.94
7.2.190.0070.00915.16
7.2.180.0050.00515.02
7.2.170.0030.01115.09
7.2.160.0060.00715.14
7.2.150.0070.00816.85
7.2.140.0070.00816.95
7.2.130.0070.01116.82
7.2.120.0070.01016.99
7.2.110.0080.00316.97
7.2.100.0080.00717.01
7.2.90.0050.00816.91
7.2.80.0070.00416.94
7.2.70.0040.01117.05
7.2.60.0140.00216.79
7.2.50.0030.01216.75
7.2.40.0090.00517.01
7.2.30.0040.01316.98
7.2.20.0080.00917.02
7.2.10.0070.00916.93
7.2.00.0030.01017.69
7.1.330.0060.00915.88
7.1.320.0050.00815.57
7.1.310.0030.01015.81
7.1.300.0040.00915.81
7.1.290.0070.00215.89
7.1.280.0030.01015.87
7.1.270.0070.00515.92
7.1.260.0040.01015.72
7.1.250.0090.00515.69
7.1.240.0020.01215.83
7.1.230.0070.00915.92
7.1.220.0080.00515.89
7.1.210.0070.00815.89
7.1.200.0090.00415.95
7.1.190.0060.01015.74
7.1.180.0050.01115.77
7.1.170.0030.01115.58
7.1.160.0050.01015.81
7.1.150.0060.00815.65
7.1.140.0060.00615.70
7.1.130.0040.00615.76
7.1.120.0040.00915.83
7.1.110.0060.00615.77
7.1.100.0240.00615.70
7.1.90.0080.00815.81
7.1.80.0020.01215.83
7.1.70.0050.00716.35
7.1.60.0080.00917.18
7.1.50.0090.00916.24
7.1.40.0050.01015.88
7.1.30.0060.00715.81
7.1.20.0040.01115.74
7.1.10.0020.00815.66
7.1.00.0060.03117.90
7.0.330.0060.00915.39
7.0.320.0110.00515.26
7.0.310.0040.01215.41
7.0.300.0050.00915.50
7.0.290.0030.01015.34
7.0.280.0070.00715.45
7.0.270.0070.00615.37
7.0.260.0060.00815.49
7.0.250.0060.00815.38
7.0.240.0070.00315.45
7.0.230.0020.00915.57
7.0.220.0070.00615.47
7.0.210.0090.00915.41
7.0.200.0020.01015.78
7.0.190.0040.01115.42
7.0.180.0060.00515.33
7.0.170.0050.00715.48
7.0.160.0050.00815.49
7.0.150.0070.00715.40
7.0.140.0020.03117.56
7.0.130.0060.01015.38
7.0.120.0060.00715.47
7.0.110.0030.01115.43
7.0.100.0090.02616.94
7.0.90.0030.03516.82
7.0.80.0050.02117.05
7.0.70.0040.02517.04
7.0.60.0050.03116.89
7.0.50.0050.02517.13
7.0.40.0070.02815.80
7.0.30.0050.03215.83
7.0.20.0040.03215.78
7.0.10.0040.02215.79
7.0.00.0060.02115.74
5.6.400.0050.00914.40
5.6.390.0090.00614.33
5.6.380.0030.01214.58
5.6.370.0050.00914.41
5.6.360.0020.00814.54
5.6.350.0090.00914.39
5.6.340.0050.00914.48
5.6.330.0050.00814.51
5.6.320.0060.00414.60
5.6.310.0080.00814.63
5.6.300.0070.00514.31
5.6.290.0060.00614.46
5.6.280.0060.03216.59
5.6.270.0110.00514.67
5.6.260.0090.00514.46
5.6.250.0060.03016.58
5.6.240.0100.01616.40
5.6.230.0060.03316.39
5.6.220.0050.03016.56
5.6.210.0060.02116.50
5.6.200.0090.02016.57
5.6.190.0040.02116.50
5.6.180.0050.03216.60
5.6.170.0020.03716.75
5.6.160.0020.03216.48
5.6.150.0050.02216.49
5.6.140.0020.02516.55
5.6.130.0040.03016.77
5.6.120.0060.03316.65
5.6.110.0060.03516.59
5.6.100.0040.02616.58
5.6.90.0020.04016.54
5.6.80.0120.03016.32
5.6.70.0050.02616.28
5.6.60.0050.02816.31
5.6.50.0080.01816.33
5.6.40.0080.02616.37
5.6.30.0020.03816.31
5.6.20.0060.02916.34
5.6.10.0020.02416.45
5.6.00.0070.02016.31
5.5.380.0040.03416.35
5.5.370.0080.03016.30
5.5.360.0070.03216.28
5.5.350.0070.02816.44
5.5.340.0070.03416.55
5.5.330.0080.02616.43
5.5.320.0030.03116.49
5.5.310.0040.02016.43
5.5.300.0150.02616.61
5.5.290.0080.02916.56
5.5.280.0120.02816.39
5.5.270.0060.03016.47
5.5.260.0110.02716.56
5.5.250.0010.03316.48
5.5.240.0050.03216.18
5.5.230.0040.03116.29
5.5.220.0070.03016.31
5.5.210.0040.02716.24
5.5.200.0040.03216.37
5.5.190.0070.03316.29
5.5.180.0090.02816.15
5.5.170.0070.00714.27
5.5.160.0090.02716.15
5.5.150.0040.02816.22
5.5.140.0040.01916.35
5.5.130.0040.03216.24
5.5.120.0050.02116.15
5.5.110.0040.03316.18
5.5.100.0050.03516.13
5.5.90.0020.02916.31
5.5.80.0060.02016.29
5.5.70.0050.02816.09
5.5.60.0020.03616.19
5.5.50.0090.02916.30
5.5.40.0090.01816.18
5.5.30.0090.02816.08
5.5.20.0090.01716.28
5.5.10.0080.01616.41
5.5.00.0020.02316.21
5.4.450.0030.03615.27
5.4.440.0030.02015.22
5.4.430.0050.01715.28
5.4.420.0090.02015.25
5.4.410.0070.02915.19
5.4.400.0080.01615.11
5.4.390.0030.03415.17
5.4.380.0100.01515.04
5.4.370.0030.03215.15
5.4.360.0020.03315.04
5.4.350.0030.03115.12
5.4.340.0060.02815.10
5.4.330.0060.00713.14
5.4.320.0040.02815.12
5.4.310.0020.02115.11
5.4.300.0080.02115.17
5.4.290.0030.02015.10
5.4.280.0070.01815.13
5.4.270.0050.02015.11
5.4.260.0060.03015.11
5.4.250.0060.01915.13
5.4.240.0070.02915.16
5.4.230.0100.01915.10
5.4.220.0050.01715.04
5.4.210.0060.03015.12
5.4.200.0060.02715.10
5.4.190.0070.02815.14
5.4.180.0020.01915.15
5.4.170.0020.02215.12
5.4.160.0040.02215.16
5.4.150.0050.01915.06
5.4.140.0050.01614.23
5.4.130.0040.01414.21
5.4.120.0030.01814.21
5.4.110.0030.01914.22
5.4.100.0050.01414.21
5.4.90.0040.01414.25
5.4.80.0040.01614.21
5.4.70.0020.01814.23
5.4.60.0030.01614.22
5.4.50.0010.01814.24
5.4.40.0040.01414.27
5.4.30.0030.01614.22
5.4.20.0010.02014.20
5.4.10.0080.01514.21
5.4.00.0060.01414.04
5.3.290.0070.03013.63
5.3.280.0020.02613.58
5.3.270.0060.01713.57
5.3.260.0020.01913.62
5.3.250.0040.01513.61
5.3.240.0040.01613.63
5.3.230.0020.01613.63
5.3.220.0050.01413.60
5.3.210.0040.01613.61
5.3.200.0040.01713.56
5.3.190.0020.02013.61
5.3.180.0060.01313.61
5.3.170.0020.02013.60
5.3.160.0020.01713.61
5.3.150.0000.01813.56
5.3.140.0040.01513.60
5.3.130.0050.01713.56
5.3.120.0030.01913.61
5.3.110.0040.01513.56
5.3.100.0060.01113.38
5.3.90.0020.01513.39
5.3.80.0060.01413.36
5.3.70.0040.01313.36
5.3.60.0070.01313.43
5.3.50.0030.02113.36
5.3.40.0020.01513.38
5.3.30.0050.01513.38
5.3.20.0030.01713.32
5.3.10.0030.01413.28
5.3.00.0020.01513.30
5.2.170.0100.02011.53
5.2.160.0070.03011.53
5.2.150.0030.02711.53
5.2.140.0130.02011.53
5.2.130.0070.02311.53
5.2.120.0000.02711.53
5.2.110.0070.02011.53
5.2.100.0070.02311.53
5.2.90.0100.03011.53
5.2.80.0000.03311.53
5.2.70.0000.03311.53
5.2.60.0000.03011.53
5.2.50.0070.02011.53
5.2.40.0030.03011.53
5.2.30.0000.02711.53
5.2.20.0030.02311.53
5.2.10.0000.02711.53
5.2.00.0000.02311.53
5.1.60.0000.02011.53
5.1.50.0030.01711.53
5.1.40.0030.02311.53
5.1.30.0000.02311.53
5.1.20.0000.02711.53
5.1.10.0000.02311.53
5.1.00.0000.02711.53
5.0.50.0030.01711.53
5.0.40.0070.02311.53
5.0.30.0030.03711.53
5.0.20.0030.04311.53
5.0.10.0000.04311.53
5.0.00.0000.03711.53
4.4.90.0000.01311.53
4.4.80.0000.01311.53
4.4.70.0000.01711.53
4.4.60.0000.01311.53
4.4.50.0000.01311.53
4.4.40.0000.02011.53
4.4.30.0000.01311.53
4.4.20.0030.01311.53
4.4.10.0030.01011.53
4.4.00.0000.02311.53
4.3.110.0000.01311.53
4.3.100.0000.01711.53
4.3.90.0000.01311.53
4.3.80.0030.05311.53
4.3.70.0000.03311.53
4.3.60.0030.03311.53
4.3.50.0000.02711.53
4.3.40.0000.03011.53
4.3.30.0130.02011.53
4.3.20.0030.02311.53
4.3.10.0000.02011.53
4.3.00.0000.03011.53

preferences:
39.3 ms | 401 KiB | 5 Q