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.01418.30
8.3.50.0120.00520.96
8.3.40.0110.00418.64
8.3.30.0150.00019.08
8.3.20.0000.00720.10
8.3.10.0000.01422.05
8.3.00.0080.00022.33
8.2.180.0150.00416.63
8.2.170.0070.01422.96
8.2.160.0030.01019.39
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0090.00926.16
8.2.120.0050.00319.77
8.2.110.0070.00319.39
8.2.100.0000.01217.79
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0050.00318.03
8.2.50.0030.00518.07
8.2.40.0050.00218.16
8.2.30.0030.00818.10
8.2.20.0000.00817.59
8.2.10.0000.00817.87
8.2.00.0040.00417.68
8.1.280.0030.01425.92
8.1.270.0110.00620.16
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0000.00821.37
8.1.230.0110.00017.45
8.1.220.0000.00817.77
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0000.00817.36
8.1.180.0040.00420.53
8.1.170.0070.00018.59
8.1.160.0000.00722.10
8.1.150.0030.00618.70
8.1.140.0060.00317.42
8.1.130.0030.00317.84
8.1.120.0050.00217.36
8.1.110.0040.00417.45
8.1.100.0000.00717.50
8.1.90.0040.00417.35
8.1.80.0030.00517.44
8.1.70.0000.00717.34
8.1.60.0050.00317.60
8.1.50.0030.00517.54
8.1.40.0000.00717.56
8.1.30.0000.00717.53
8.1.20.0030.00617.55
8.1.10.0000.00817.50
8.1.00.0080.00017.59
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0030.00318.34
8.0.270.0070.00017.22
8.0.260.0030.00316.80
8.0.250.0030.00317.08
8.0.240.0030.00616.96
8.0.230.0040.00417.05
8.0.220.0000.00716.95
8.0.210.0030.00416.95
8.0.200.0070.00017.08
8.0.190.0060.00316.89
8.0.180.0040.00417.02
8.0.170.0070.00017.00
8.0.160.0000.00717.03
8.0.150.0000.00716.82
8.0.140.0000.00816.82
8.0.130.0050.00213.40
8.0.120.0050.00316.86
8.0.110.0000.00716.95
8.0.100.0000.00716.98
8.0.90.0070.00016.86
8.0.80.0070.01416.91
8.0.70.0000.00716.95
8.0.60.0000.00717.03
8.0.50.0040.00416.91
8.0.30.0090.00917.04
8.0.20.0110.01117.40
8.0.10.0000.00717.02
8.0.00.0120.00716.72
7.4.330.0040.00015.00
7.4.320.0030.00316.51
7.4.300.0030.00316.51
7.4.290.0000.00716.49
7.4.280.0040.00416.48
7.4.270.0040.00416.62
7.4.260.0070.00016.44
7.4.250.0000.00716.36
7.4.240.0050.00216.50
7.4.230.0030.00316.60
7.4.220.0090.00916.55
7.4.210.0070.00916.52
7.4.200.0000.00716.69
7.4.190.0000.00716.40
7.4.160.0060.00916.60
7.4.150.0140.00917.40
7.4.140.0110.00717.86
7.4.130.0130.00516.52
7.4.120.0100.00816.68
7.4.110.0100.00716.57
7.4.100.0140.00416.51
7.4.90.0070.01016.35
7.4.80.0120.00819.39
7.4.70.0060.01116.55
7.4.60.0030.01416.41
7.4.50.0040.00416.53
7.4.40.0030.01022.77
7.4.30.0150.00416.42
7.4.00.0070.01015.17
7.3.330.0050.00013.22
7.3.320.0030.00313.36
7.3.310.0000.00616.25
7.3.300.0000.00716.37
7.3.290.0140.00316.32
7.3.280.0050.01016.34
7.3.270.0130.00317.40
7.3.260.0140.00316.37
7.3.250.0100.01116.52
7.3.240.0100.00716.50
7.3.230.0100.00716.39
7.3.210.0000.01716.30
7.3.200.0060.00919.39
7.3.190.0070.01116.39
7.3.180.0120.00616.22
7.3.170.0090.01216.39
7.3.160.0120.00616.39
7.3.120.0060.00914.90
7.2.330.0030.01416.65
7.2.320.0120.00416.85
7.2.310.0140.00316.67
7.2.300.0100.01016.68
7.2.290.0080.00816.62
7.2.00.0030.01019.48
7.1.100.0040.00717.94
7.1.70.0030.00517.16
7.1.60.0070.01719.82
7.1.50.0030.01716.79
7.1.00.0030.03322.33
7.0.200.0050.00915.05
7.0.140.0000.07721.97
7.0.60.0100.04320.08
7.0.50.0070.08717.82
7.0.40.0070.06320.21
7.0.30.0200.04720.16
7.0.20.0300.04320.23
7.0.10.0330.05320.06
7.0.00.0000.07320.33
5.6.280.0030.07321.10
5.6.210.0070.08020.71
5.6.200.0070.05018.19
5.6.190.0130.08720.64
5.6.180.3470.04020.33
5.6.170.0200.06720.57
5.6.160.0070.03720.41
5.6.150.0030.06018.14
5.6.140.0100.03318.20
5.6.130.0070.03718.18
5.6.120.0030.08321.15
5.6.110.0170.07321.00
5.6.100.0030.07321.02
5.6.90.0130.07020.97
5.6.80.0200.07020.41
5.6.70.0170.04320.43
5.5.350.0070.07720.34
5.5.340.0070.04017.95
5.5.330.0070.08320.41
5.5.320.0170.04320.40
5.5.310.0200.08720.41
5.5.300.0030.04018.08
5.5.290.0100.05317.98
5.5.280.0030.05720.84
5.5.270.0070.04020.84
5.5.260.0100.07320.77
5.5.250.0100.06020.58
5.5.240.0130.04320.26
5.4.450.0800.05719.62
5.4.440.0670.06319.31
5.4.430.1100.06019.21
5.4.420.0270.03719.37
5.4.410.0900.05719.55
5.4.400.1100.04718.51
5.4.390.1030.06018.46
5.4.380.0330.05718.73
5.4.370.0070.06018.78
5.4.360.0100.05318.76
5.4.350.0130.05318.53
5.4.340.0270.04018.78
5.4.320.0090.04912.51
5.4.310.0030.04612.50
5.4.300.0080.03712.50
5.4.290.0060.04412.50
5.4.280.0090.03312.39
5.4.270.0040.03812.40
5.4.260.0060.03712.40
5.4.250.0200.06318.68
5.4.240.0130.07319.10
5.4.230.0130.07319.00
5.4.220.0070.05719.01
5.4.210.0200.05719.10
5.4.200.0070.08018.96
5.4.190.0100.07719.02
5.4.180.0070.05318.93
5.4.170.0070.05719.02
5.4.160.0170.06718.76
5.4.150.0100.06718.79
5.4.140.0030.05316.48
5.4.130.0100.05016.59
5.4.120.0100.04716.59
5.4.110.0030.05716.50
5.4.100.0170.04316.52
5.4.90.0130.04716.42
5.4.80.0100.07016.48
5.4.70.0170.06316.50
5.4.60.0070.05016.31
5.4.50.0130.05716.50
5.4.40.0030.05016.68
5.4.30.0070.07016.45
5.4.20.0170.06016.45
5.4.10.0030.07016.30
5.4.00.0200.05716.03
5.3.290.0090.04012.80
5.3.280.0070.05714.58
5.3.270.0130.07014.59
5.3.260.0170.05014.57
5.3.250.0070.07314.59
5.3.240.0230.05714.64
5.3.230.0170.06014.43
5.3.220.0030.07714.55
5.3.210.0130.06714.40
5.3.200.0100.07314.61
5.3.190.0200.05314.65
5.3.180.0100.05314.64
5.3.170.0100.05014.55
5.3.160.0070.05014.64
5.3.150.0070.07314.58
5.3.140.0030.05314.38
5.3.130.0030.07314.54
5.3.120.0070.07714.71
5.3.110.0200.06014.63
5.3.100.0070.05014.25
5.3.90.0130.04014.10
5.3.80.0170.05714.00
5.3.70.0170.04714.24
5.3.60.0100.06314.07
5.3.50.0030.05313.93
5.3.40.0130.04714.04
5.3.30.0070.05313.74
5.3.20.0200.06013.53
5.3.10.0070.05713.82
5.3.00.0170.05313.82
5.2.170.0000.05011.13
5.2.160.0170.04311.16
5.2.150.0130.03711.23
5.2.140.0100.05311.21
5.2.130.0030.04711.01
5.2.120.0070.05311.10
5.2.110.0070.05311.18
5.2.100.0130.04311.19
5.2.90.0100.05311.07
5.2.80.0000.04711.07
5.2.70.0000.04711.25
5.2.60.0130.04711.12
5.2.50.0070.04710.99
5.2.40.0070.03710.83
5.2.30.0030.04310.98
5.2.20.0030.05710.86
5.2.10.0100.04710.95
5.2.00.0100.04710.70
5.1.60.0070.03010.00
5.1.50.0170.04010.07
5.1.40.0070.04310.05
5.1.30.0000.05010.49
5.1.20.0000.05710.45
5.1.10.0030.0479.90
5.1.00.0130.04310.12
5.0.50.0030.0378.54
5.0.40.0100.0308.50
5.0.30.0070.0538.29
5.0.20.0100.0208.13
5.0.10.0070.0338.13
5.0.00.0070.0538.14
4.4.90.0030.0307.47
4.4.80.0070.0177.47
4.4.70.0000.0277.47
4.4.60.0030.0277.47
4.4.50.0030.0277.47
4.4.40.0030.0437.47
4.4.30.0000.0307.47
4.4.20.0070.0237.47
4.4.10.0030.0237.47
4.4.00.0070.0307.47
4.3.110.0000.0277.47
4.3.100.0070.0237.47
4.3.90.0070.0237.47
4.3.80.0000.0437.47
4.3.70.0070.0177.47
4.3.60.0000.0237.47
4.3.50.0030.0237.47
4.3.40.0030.0337.47
4.3.30.0000.0237.47
4.3.20.0000.0307.47
4.3.10.0070.0237.47
4.3.00.0000.0237.18

preferences:
45.62 ms | 401 KiB | 5 Q