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(); 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.60.0070.01318.43
8.3.50.0120.00921.21
8.3.40.0120.00318.88
8.3.30.0150.00019.07
8.3.20.0150.00320.28
8.3.10.0070.01121.92
8.3.00.0080.00022.58
8.2.180.0070.01516.87
8.2.170.0110.00422.96
8.2.160.0130.00319.33
8.2.150.0070.00724.18
8.2.140.0080.00024.66
8.2.130.0130.00626.16
8.2.120.0040.00419.66
8.2.110.0060.00322.18
8.2.100.0050.00519.36
8.2.90.0060.00319.27
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0050.00318.04
8.2.50.0000.00818.07
8.2.40.0080.00018.16
8.2.30.0000.01217.93
8.2.20.0080.00017.59
8.2.10.0000.00717.72
8.2.00.0000.00717.70
8.1.280.0040.01125.92
8.1.270.0070.01318.45
8.1.260.0140.00026.35
8.1.250.0070.00028.09
8.1.240.0000.00923.68
8.1.230.0070.00319.04
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0000.00817.53
8.1.180.0000.00818.82
8.1.170.0060.00318.59
8.1.160.0000.00722.16
8.1.150.0030.00618.50
8.1.140.0080.00017.40
8.1.130.0030.00317.94
8.1.120.0000.00717.38
8.1.110.0000.00717.50
8.1.100.0040.00317.52
8.1.90.0030.00517.47
8.1.80.0000.00717.52
8.1.70.0000.00717.40
8.1.60.0000.00817.48
8.1.50.0040.00417.51
8.1.40.0030.00517.54
8.1.30.0040.00417.67
8.1.20.0000.00917.59
8.1.10.0040.00417.44
8.1.00.0000.00717.41
8.0.300.0040.00418.77
8.0.290.0000.00717.16
8.0.280.0000.00718.43
8.0.270.0000.00717.21
8.0.260.0070.00016.73
8.0.250.0050.00216.94
8.0.240.0000.00917.04
8.0.230.0000.00817.03
8.0.220.0030.00317.00
8.0.210.0070.00016.96
8.0.200.0060.00016.98
8.0.190.0000.00717.00
8.0.180.0000.00717.00
8.0.170.0040.00416.99
8.0.160.0030.00316.91
8.0.150.0030.00516.91
8.0.140.0000.00716.94
8.0.130.0070.00013.36
8.0.120.0000.00716.94
8.0.110.0040.00416.99
8.0.100.0040.00417.02
8.0.90.0080.00016.94
8.0.80.0040.01117.00
8.0.70.0000.00717.08
8.0.60.0080.00016.84
8.0.50.0070.00016.98
8.0.30.0120.00817.07
8.0.20.0100.00817.40
8.0.10.0050.00517.18
8.0.00.0110.00816.80
7.4.330.0000.00415.10
7.4.320.0040.00416.51
7.4.300.0040.00416.56
7.4.290.0030.00316.46
7.4.280.0000.00716.56
7.4.270.0000.00716.61
7.4.260.0030.00316.50
7.4.250.0000.00716.46
7.4.240.0000.00716.52
7.4.230.0000.00716.63
7.4.220.0060.01316.54
7.4.210.0030.01316.60
7.4.200.0070.00016.44
7.4.190.0070.00016.74
7.4.160.0090.00616.52
7.4.150.0150.00317.40
7.4.140.0070.01017.86
7.4.130.0130.00416.53
7.4.120.0120.00416.44
7.4.110.0070.01016.52
7.4.100.0110.00616.55
7.4.90.0170.00016.68
7.4.80.0090.00919.39
7.4.70.0060.01116.31
7.4.60.0100.00716.51
7.4.50.0000.00816.56
7.4.40.0070.00322.77
7.4.30.0110.00516.68
7.4.00.0070.00914.96
7.3.330.0000.00713.23
7.3.320.0030.00313.35
7.3.310.0000.00716.34
7.3.300.0000.00616.31
7.3.290.0070.00716.35
7.3.280.0080.00916.36
7.3.270.0040.01317.40
7.3.260.0140.01016.46
7.3.250.0150.00216.53
7.3.240.0090.00916.30
7.3.230.0100.01016.50
7.3.210.0150.00316.37
7.3.200.0040.01419.39
7.3.190.0110.01116.66
7.3.180.0000.01516.30
7.3.170.0100.01016.52
7.3.160.0080.00816.35
7.3.120.0020.01514.77
7.3.110.0070.01014.86
7.3.100.0040.01214.63
7.3.90.0090.00314.93
7.3.80.0030.00914.63
7.3.70.0030.00814.79
7.3.60.0030.01014.82
7.3.50.0000.01414.86
7.3.40.0000.01314.75
7.3.30.0000.01714.97
7.3.20.0060.00316.82
7.3.10.0060.00916.88
7.3.00.0140.00316.66
7.2.330.0070.01016.79
7.2.320.0100.00716.58
7.2.310.0030.01916.56
7.2.300.0140.00716.69
7.2.290.0090.00616.50
7.2.250.0090.01214.94
7.2.240.0040.00815.00
7.2.230.0060.00914.92
7.2.220.0030.01315.13
7.2.210.0030.00615.11
7.2.200.0000.01414.83
7.2.190.0080.00314.94
7.2.180.0060.00914.85
7.2.170.0030.01015.05
7.2.00.0090.00619.46
7.1.330.0070.00716.01
7.1.320.0030.01515.62
7.1.310.0070.00715.85
7.1.300.0030.00615.52
7.1.290.0030.01315.83
7.1.280.0040.01115.81
7.1.270.0060.00315.78
7.1.260.0100.00615.46
7.1.100.0000.01018.13
7.1.70.0040.00417.15
7.1.60.0060.00919.82
7.1.50.0090.01216.86
7.1.00.0070.03322.37
7.0.200.0080.00316.87
7.0.140.0070.07021.95
7.0.60.0130.04320.08
7.0.50.0070.06017.87
7.0.40.0100.09320.21
7.0.30.0230.04320.21
7.0.20.0170.04720.06
7.0.10.0070.09020.10
7.0.00.0130.03720.15
5.6.280.0030.07320.96
5.6.210.0270.07020.48
5.6.200.0070.04318.22
5.6.190.0070.04720.57
5.6.180.0170.04320.48
5.6.170.0170.04020.51
5.6.160.0130.08020.55
5.6.150.0100.03318.15
5.6.140.0100.05718.15
5.6.130.0070.04018.14
5.6.120.0100.08021.10
5.6.110.0130.06321.02
5.6.100.0070.05021.12
5.6.90.0130.07020.98
5.6.80.0100.06320.29
5.6.70.3800.03020.39
5.5.350.0130.04020.44
5.5.340.0070.08017.98
5.5.330.0070.07320.40
5.5.320.0100.07320.30
5.5.310.0370.07720.29
5.5.300.0030.08317.95
5.5.290.0070.05317.96
5.5.280.0030.05020.69
5.5.270.0100.08020.87
5.5.260.0070.04320.68
5.5.250.0070.07720.50
5.5.240.0230.04020.16
5.4.450.0530.04319.61
5.4.440.0170.05319.40
5.4.430.0270.04019.14
5.4.420.0070.06019.44
5.4.410.0200.04718.97
5.4.400.0930.06018.75
5.4.390.1030.06018.80
5.4.380.0200.05718.61
5.4.370.0270.06318.83
5.4.360.0130.05018.47
5.4.350.0230.04318.53
5.4.340.0200.04318.63
5.4.320.0070.03512.50
5.4.310.0030.04412.50
5.4.300.0060.04212.51
5.4.290.0120.03312.50
5.4.280.0050.04312.39
5.4.270.0060.03812.40
5.4.260.0060.03712.40
5.4.250.0170.06318.84
5.4.240.0100.05318.75
5.4.230.0170.06718.91
5.4.220.0030.06019.01
5.4.210.0070.05318.96
5.4.200.0030.06018.91
5.4.190.0030.05318.75
5.4.180.0100.06718.93
5.4.170.0070.07318.77
5.4.160.0130.06718.72
5.4.150.0030.06318.78
5.4.140.0070.06316.42
5.4.130.0030.07016.53
5.4.120.0070.06716.49
5.4.110.0130.04316.49
5.4.100.0170.04316.38
5.4.90.0130.06716.52
5.4.80.0170.06016.37
5.4.70.0070.07016.55
5.4.60.0070.05316.36
5.4.50.0030.07716.48
5.4.40.0030.07016.50
5.4.30.0100.04716.34
5.4.20.0070.07016.50
5.4.10.0170.04716.48
5.4.00.0100.05015.94
5.3.290.0060.04012.80
5.3.280.0100.06014.58
5.3.270.0100.06714.53
5.3.260.0130.06714.44
5.3.250.0130.06714.67
5.3.240.0000.06014.68
5.3.230.0100.07014.60
5.3.220.0070.05014.71
5.3.210.0230.06314.40
5.3.200.0100.05014.73
5.3.190.0070.06714.63
5.3.180.0030.05314.55
5.3.170.0170.06014.65
5.3.160.0070.05014.59
5.3.150.0100.08014.57
5.3.140.0070.05314.55
5.3.130.0100.06714.38
5.3.120.0170.06314.55
5.3.110.0170.06014.38
5.3.100.0030.05313.94
5.3.90.0070.05314.09
5.3.80.0130.05013.92
5.3.70.0170.04714.24
5.3.60.0100.04714.08
5.3.50.0070.05314.17
5.3.40.0030.06014.04
5.3.30.0130.04713.99
5.3.20.0100.05013.91
5.3.10.0100.05313.73
5.3.00.0100.06013.61
5.2.170.0000.05011.13
5.2.160.0100.04711.11
5.2.150.0130.03711.23
5.2.140.0070.06011.30
5.2.130.0000.04711.16
5.2.120.0070.03311.11
5.2.110.0000.04311.09
5.2.100.0130.04711.16
5.2.90.0000.04711.32
5.2.80.0000.05711.16
5.2.70.0070.05311.18
5.2.60.0030.04711.11
5.2.50.0100.05311.20
5.2.40.0070.05310.98
5.2.30.0030.04710.96
5.2.20.0000.05711.05
5.2.10.0130.03710.93
5.2.00.0100.04310.81
5.1.60.0070.03010.10
5.1.50.0030.0379.99
5.1.40.0070.0339.96
5.1.30.0030.03710.34
5.1.20.0070.03310.44
5.1.10.0000.03710.13
5.1.00.0030.05310.04
5.0.50.0030.0308.74
5.0.40.0030.0278.32
5.0.30.0030.0538.46
5.0.20.0100.0238.29
5.0.10.0100.0238.01
5.0.00.0100.0337.95
4.4.90.0070.0277.46
4.4.80.0000.0337.46
4.4.70.0000.0237.46
4.4.60.0000.0237.46
4.4.50.0000.0237.46
4.4.40.0030.0337.46
4.4.30.0030.0277.46
4.4.20.0030.0237.46
4.4.10.0030.0337.46
4.4.00.0070.0307.46
4.3.110.0100.0237.46
4.3.100.0030.0207.46
4.3.90.0030.0307.46
4.3.80.0030.0337.46
4.3.70.0070.0237.46
4.3.60.0070.0237.46
4.3.50.0070.0177.46
4.3.40.0030.0337.46
4.3.30.0070.0177.46
4.3.20.0000.0277.46
4.3.10.0030.0207.46
4.3.00.0130.0206.88

preferences:
48.94 ms | 400 KiB | 5 Q