3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'A' => array(1, 2, 3, 4), 'B' => array(5, 6), 'C' => array('a', 'b', 'c')); $values=""; $val = array(array()); function makeCombinations($array,$values){ foreach($array as $value) { if(is_array($value)) makeCombinations($value,$values); else array_push($val,$value); } } makeCombinations($array,$values); print_r($val); //echo $values;

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.70.0090.00916.88
8.3.60.0140.00718.53
8.3.50.0100.00621.99
8.3.40.0060.00918.99
8.3.30.0120.00319.10
8.3.20.0070.00720.25
8.3.10.0060.00922.09
8.3.00.0000.00822.43
8.2.180.0160.00316.50
8.2.170.0090.00622.96
8.2.160.0060.00919.29
8.2.150.0070.00724.18
8.2.140.0100.01324.66
8.2.130.0110.00726.16
8.2.120.0000.00819.45
8.2.110.0000.01022.20
8.2.100.0040.00817.91
8.2.90.0000.00817.72
8.2.80.0000.01017.97
8.2.70.0060.00317.50
8.2.60.0040.00417.92
8.2.50.0060.00318.07
8.2.40.0040.00418.09
8.2.30.0070.00318.17
8.2.20.0000.00717.64
8.2.10.0040.00417.68
8.2.00.0030.00517.80
8.1.280.0070.01525.92
8.1.270.0000.00818.52
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0150.00322.45
8.1.230.0070.00420.89
8.1.220.0000.00817.74
8.1.210.0030.00618.87
8.1.200.0040.00717.47
8.1.190.0090.00017.23
8.1.180.0040.00420.50
8.1.170.0000.00818.66
8.1.160.0040.00422.13
8.1.150.0050.00518.60
8.1.140.0000.00717.41
8.1.130.0070.00017.75
8.1.120.0040.00417.46
8.1.110.0070.00017.49
8.1.100.0070.00017.37
8.1.90.0000.00717.52
8.1.80.0030.00317.43
8.1.70.0070.00017.43
8.1.60.0050.00317.49
8.1.50.0030.00617.45
8.1.40.0040.00417.51
8.1.30.0040.00417.60
8.1.20.0050.00317.63
8.1.10.0080.00017.49
8.1.00.0070.00017.43
8.0.300.0090.00019.89
8.0.290.0080.00316.59
8.0.280.0040.00418.34
8.0.270.0070.00017.23
8.0.260.0000.00816.77
8.0.250.0000.00717.04
8.0.240.0030.00617.00
8.0.230.0020.00517.00
8.0.220.0030.00316.95
8.0.210.0000.00816.95
8.0.200.0060.00017.05
8.0.190.0000.00717.00
8.0.180.0030.00617.02
8.0.170.0040.00416.92
8.0.160.0040.00416.99
8.0.150.0000.00716.88
8.0.140.0000.00716.83
8.0.130.0000.00713.46
8.0.120.0040.00416.87
8.0.110.0050.00216.87
8.0.100.0030.00516.86
8.0.90.0000.00716.95
8.0.80.0090.00916.96
8.0.70.0040.00416.85
8.0.60.0000.00716.85
8.0.50.0050.00216.84
8.0.30.0070.01517.21
8.0.20.0170.00817.40
8.0.10.0000.00717.13
8.0.00.0060.01416.91
7.4.330.0050.00015.00
7.4.320.0000.00716.43
7.4.300.0000.00616.57
7.4.290.0000.00716.59
7.4.280.0000.00716.43
7.4.270.0040.00416.60
7.4.260.0040.00416.59
7.4.250.0040.00416.55
7.4.240.0030.00316.62
7.4.230.0030.00316.39
7.4.220.0090.00916.63
7.4.210.0070.00916.59
7.4.200.0040.00416.61
7.4.190.0040.00416.73
7.4.160.0100.00516.53
7.4.150.0110.00717.40
7.4.140.0050.01417.86
7.4.130.0090.00716.68
7.4.120.0110.00616.57
7.4.110.0120.00416.52
7.4.100.0090.00916.43
7.4.90.0120.00616.57
7.4.80.0080.00819.39
7.4.70.0080.00916.51
7.4.60.0060.01016.50
7.4.50.0030.00616.28
7.4.40.0000.01722.77
7.4.30.0110.00616.62
7.4.00.0080.00915.16
7.3.330.0000.00613.23
7.3.320.0000.00513.31
7.3.310.0000.00716.30
7.3.300.0030.00316.22
7.3.290.0090.00616.30
7.3.280.0080.00816.39
7.3.270.0070.01017.40
7.3.260.0180.00616.35
7.3.250.0120.00916.35
7.3.240.0100.01016.47
7.3.230.0120.01216.54
7.3.210.0150.00616.43
7.3.200.0030.01319.39
7.3.190.0100.01316.36
7.3.180.0060.01016.33
7.3.170.0090.00916.39
7.3.160.0070.01516.39
7.3.120.0080.00914.94
7.3.110.0060.01214.73
7.3.100.0060.00914.91
7.3.90.0060.00314.54
7.3.80.0140.00014.76
7.3.70.0060.00614.88
7.3.60.0030.00914.96
7.3.50.0030.01014.76
7.3.40.0040.01114.93
7.3.30.0040.01214.68
7.3.20.0150.00016.70
7.3.10.0070.00716.66
7.3.00.0030.01316.70
7.2.330.0080.00816.71
7.2.320.0030.01516.47
7.2.310.0120.00916.69
7.2.300.0130.00716.68
7.2.290.0030.01316.58
7.2.250.0090.01215.22
7.2.240.0040.01814.87
7.2.230.0060.00615.15
7.2.220.0030.01014.82
7.2.210.0080.00315.09
7.2.200.0080.00315.09
7.2.190.0070.00715.12
7.2.180.0040.01414.79
7.2.170.0060.00915.13
7.2.00.0080.00819.52
7.1.330.0040.01115.73
7.1.320.0080.00615.90
7.1.310.0080.00415.75
7.1.300.0040.01115.35
7.1.290.0060.00915.53
7.1.280.0090.00615.68
7.1.270.0030.01015.97
7.1.260.0000.01415.46
7.1.100.0040.00818.11
7.1.70.0070.00317.11
7.1.60.0100.01019.82
7.1.50.0100.01316.96
7.1.00.0070.06022.36
7.0.200.0230.00614.84
7.0.140.0100.06722.21
7.0.60.0130.07719.99
7.0.50.0030.07017.87
7.0.40.0070.04320.02
7.0.30.0430.07020.33
7.0.20.0270.05020.06
7.0.10.0430.06720.23
7.0.00.0130.05720.26
5.6.280.0030.07320.99
5.6.210.0100.07720.48
5.6.200.0000.06318.29
5.6.190.0070.09020.57
5.6.180.3500.04320.64
5.6.170.0270.08720.58
5.6.160.0200.06720.50
5.6.150.0100.07718.23
5.6.140.0170.07018.15
5.6.130.0070.05718.20
5.6.120.0170.07320.99
5.6.110.0030.07720.99
5.6.100.0070.08321.11
5.6.90.0000.06320.97
5.6.80.0130.06020.38
5.6.70.0200.04020.44
5.5.350.0000.07320.44
5.5.340.0100.05017.96
5.5.330.0030.04320.56
5.5.320.0200.06720.36
5.5.310.0230.04720.25
5.5.300.0100.05717.99
5.5.290.0030.08318.09
5.5.280.0070.05320.79
5.5.270.0030.04020.93
5.5.260.0030.07020.87
5.5.250.0070.08720.62
5.5.240.0070.08020.17
5.4.450.0800.05019.55
5.4.440.0600.06719.30
5.4.430.1070.06319.31
5.4.420.1070.07719.37
5.4.410.0730.06019.42
5.4.400.1070.05718.75
5.4.390.0800.06718.73
5.4.380.0470.06318.80
5.4.370.0230.04018.70
5.4.360.0070.05718.59
5.4.350.0170.05318.61
5.4.340.0130.05318.57
5.4.320.0080.03612.50
5.4.310.0100.03412.50
5.4.300.0080.03312.51
5.4.290.0060.04412.50
5.4.280.0060.03512.39
5.4.270.0110.03812.40
5.4.260.0040.04512.40
5.4.250.0100.05719.03
5.4.240.0100.07718.96
5.4.230.0130.08319.03
5.4.220.0230.04319.10
5.4.210.0070.08019.00
5.4.200.0100.08018.80
5.4.190.0130.07018.79
5.4.180.0200.06318.96
5.4.170.0130.07018.96
5.4.160.0070.05318.98
5.4.150.0100.07018.81
5.4.140.0200.05716.45
5.4.130.0070.07316.37
5.4.120.0130.05716.25
5.4.110.0070.07316.55
5.4.100.0130.05316.42
5.4.90.0000.05316.41
5.4.80.0100.05316.55
5.4.70.0030.05316.48
5.4.60.0070.07316.39
5.4.50.0200.06316.41
5.4.40.0170.06016.70
5.4.30.0070.07016.50
5.4.20.0130.04716.44
5.4.10.0070.05716.36
5.4.00.0130.06315.95
5.3.290.0130.03912.80
5.3.280.0100.05014.67
5.3.270.0170.06714.58
5.3.260.0130.05014.59
5.3.250.0170.04314.68
5.3.240.0130.07014.58
5.3.230.0030.07314.59
5.3.220.0030.06014.65
5.3.210.0170.04314.63
5.3.200.0170.06014.47
5.3.190.0170.05714.40
5.3.180.0030.05714.64
5.3.170.0130.04314.74
5.3.160.0100.07314.57
5.3.150.0030.07314.47
5.3.140.0170.06314.64
5.3.130.0130.07314.63
5.3.120.0030.07714.52
5.3.110.0070.06714.52
5.3.100.0000.07714.02
5.3.90.0070.06714.03
5.3.80.0100.06014.01
5.3.70.0170.06013.99
5.3.60.0130.06313.98
5.3.50.0070.06713.78
5.3.40.0070.04713.94
5.3.30.0030.05013.93
5.3.20.0100.04713.54
5.3.10.0030.06313.63
5.3.00.0070.05013.62
5.2.170.0070.04311.21
5.2.160.0100.05011.23
5.2.150.0000.04711.05
5.2.140.0100.05010.97
5.2.130.0230.03711.01
5.2.120.0000.04311.05
5.2.110.0030.05711.17
5.2.100.0130.05310.94
5.2.90.0170.04311.26
5.2.80.0100.03711.07
5.2.70.0070.05011.22
5.2.60.0100.03711.22
5.2.50.0170.04311.11
5.2.40.0000.04711.22
5.2.30.0100.05710.96
5.2.20.0100.04711.03
5.2.10.0100.04311.02
5.2.00.0130.03710.70
5.1.60.0130.04010.05
5.1.50.0130.03010.20
5.1.40.0000.0539.95
5.1.30.0130.04710.42
5.1.20.0070.03710.34
5.1.10.0070.04710.07
5.1.00.0070.04710.02
5.0.50.0030.0408.64
5.0.40.0000.0438.45
5.0.30.0030.0608.29
5.0.20.0030.0408.20
5.0.10.0000.0338.16
5.0.00.0000.0638.40
4.4.90.0000.0377.47
4.4.80.0000.0337.47
4.4.70.0030.0207.47
4.4.60.0070.0237.47
4.4.50.0030.0307.47
4.4.40.0030.0437.47
4.4.30.0070.0177.47
4.4.20.0030.0207.46
4.4.10.0000.0337.46
4.4.00.0000.0407.46
4.3.110.0070.0307.46
4.3.100.0030.0307.46
4.3.90.0030.0307.46
4.3.80.0000.0377.46
4.3.70.0000.0237.46
4.3.60.0000.0307.46
4.3.50.0030.0237.46
4.3.40.0030.0407.46
4.3.30.0000.0307.46
4.3.20.0000.0237.46
4.3.10.0030.0207.46
4.3.00.0200.0237.19

preferences:
43.16 ms | 401 KiB | 5 Q