3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ["abc", "defs", "ghi"]; $b = ["abcs", "def", "ghis"]; $temp = array_map(null, $a, $b); function combinations($arrays) { $result = []; $arrays = array_values($arrays); $sizeIn = sizeof($arrays); $size = $sizeIn > 0 ? 1 : 0; foreach ($arrays as $array) { $size = $size * sizeof($array); } for ($i = 0; $i < $size; $i++) { $result[$i] = []; for ($j = 0; $j < $sizeIn; $j++) { array_push($result[$i], current($arrays[$j])); } for ($j = ($sizeIn - 1); $j >= 0; $j--) { if (next($arrays[$j])) { break; } elseif (isset($arrays[$j])) { reset($arrays[$j]); } } } return $result; } $res = combinations($temp); $temp = array_map(function($item){ return implode(" ", $item); },$res); foreach($temp as $val){ echo $val."\n"; }

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.4.140.0110.01017.38
8.4.130.0080.00217.64
8.4.120.0120.00824.15
8.4.110.0080.00522.44
8.4.100.0090.01118.68
8.4.90.0110.00918.79
8.4.80.0030.00518.97
8.4.70.0110.00817.93
8.4.60.0150.00618.75
8.4.50.0090.00820.32
8.4.40.0060.00317.98
8.4.30.0070.01122.35
8.4.20.0140.00719.08
8.4.10.0100.00019.64
8.3.270.0090.01216.54
8.3.260.0120.00716.53
8.3.250.0040.00418.97
8.3.240.0100.00817.00
8.3.230.0120.00716.53
8.3.220.0050.00319.03
8.3.210.0130.00618.63
8.3.200.0080.00316.54
8.3.190.0110.00917.38
8.3.180.0080.01116.57
8.3.170.0090.00916.92
8.3.160.0100.01016.67
8.3.150.0070.00716.58
8.3.140.0110.00716.29
8.3.130.0050.00316.72
8.3.120.0080.00018.86
8.3.110.0030.00516.63
8.3.100.0120.00324.06
8.3.90.0090.00026.77
8.3.80.0040.00416.50
8.3.70.0080.00816.63
8.3.60.0060.00918.27
8.3.50.0130.00822.11
8.3.40.0040.01118.66
8.3.30.0070.00718.84
8.3.20.0080.00020.90
8.3.10.0040.00420.11
8.3.00.0000.00923.56
8.2.290.0120.00620.55
8.2.280.0090.00918.66
8.2.270.0130.00317.22
8.2.260.0110.00718.30
8.2.250.0000.00816.69
8.2.240.0030.00618.84
8.2.230.0000.00820.94
8.2.220.0030.00637.54
8.2.210.0100.01026.77
8.2.200.0060.00316.63
8.2.190.0140.00716.75
8.2.180.0090.00616.63
8.2.170.0130.00622.96
8.2.160.0100.00321.19
8.2.150.0000.00824.18
8.2.140.0110.00424.66
8.2.130.0080.00026.16
8.2.120.0060.00319.89
8.2.110.0060.00321.12
8.2.100.0080.00418.03
8.2.90.0000.00817.84
8.2.80.0060.00318.05
8.2.70.0050.00317.93
8.2.60.0040.00417.93
8.2.50.0030.00518.28
8.2.40.0110.00018.34
8.2.30.0040.00418.12
8.2.20.0040.00418.01
8.2.10.0080.00019.32
8.2.00.0000.00719.42
8.1.330.0100.00821.98
8.1.320.0090.01015.84
8.1.310.0070.01118.44
8.1.300.0080.00417.87
8.1.290.0060.00318.88
8.1.280.0100.01025.92
8.1.270.0080.00023.83
8.1.260.0040.00426.35
8.1.250.0110.00728.09
8.1.240.0090.00022.27
8.1.230.0130.00520.37
8.1.220.0040.00417.88
8.1.210.0030.00518.77
8.1.200.0030.00617.36
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0050.00318.63
8.1.160.0000.00818.89
8.1.150.0040.00418.96
8.1.140.0040.00418.89
8.1.130.0000.00720.02
8.1.120.0050.00317.47
8.1.110.0000.00717.45
8.1.100.0040.00417.55
8.1.90.0060.00317.52
8.1.80.0040.00417.48
8.1.70.0030.00517.45
8.1.60.0040.00417.65
8.1.50.0040.00417.41
8.1.40.0070.00317.52
8.1.30.0080.00017.66
8.1.20.0040.00717.55
8.1.10.0040.00417.59
8.1.00.0080.00017.49
8.0.300.0040.00419.64
8.0.290.0100.00016.63
8.0.280.0030.00318.36
8.0.270.0040.00417.25
8.0.260.0070.00020.11
8.0.250.0030.00316.85
8.0.240.0070.00016.98
8.0.230.0050.00217.00
8.0.220.0070.00016.87
8.0.210.0030.00316.75
8.0.200.0070.00016.95
8.0.190.0040.00416.85
8.0.180.0080.00016.98
8.0.170.0030.00516.95
8.0.160.0000.00816.80
8.0.150.0000.00816.79
8.0.140.0040.00416.75
8.0.130.0000.00613.34
8.0.120.0080.00016.86
8.0.110.0040.00416.87
8.0.100.0040.00416.87
8.0.90.0060.00316.84
8.0.80.0030.01216.90
8.0.70.0000.00816.96
8.0.60.0070.00016.80
8.0.50.0040.00416.78
8.0.30.0130.00717.07
8.0.20.0060.01217.18
8.0.10.0000.00816.80
8.0.00.0070.01016.69
7.4.330.0000.00515.55
7.4.320.0030.00316.52
7.4.300.0070.00016.46
7.4.290.0050.00316.54
7.4.280.0040.00716.62
7.4.270.0080.00016.41
7.4.260.0070.00016.60
7.4.250.0000.00716.50
7.4.240.0050.00216.54
7.4.230.0000.00716.42
7.4.220.0000.00716.59
7.4.210.0070.00916.51
7.4.200.0000.00716.70
7.4.140.0130.00617.86
7.4.130.0100.00716.60
7.4.120.0120.00616.53
7.4.110.0060.01116.28
7.4.100.0090.00916.59
7.4.90.0080.01216.60
7.4.80.0090.01519.39
7.4.70.0120.01216.57
7.4.60.0090.00616.60
7.4.50.0070.01116.59
7.4.40.0030.01316.34
7.4.00.0070.00814.97
7.3.330.0020.00213.37
7.3.320.0050.00013.23
7.3.310.0030.00516.26
7.3.300.0000.00616.42
7.3.290.0030.00316.38
7.3.280.0060.00916.41
7.3.260.0100.00816.52
7.3.240.0080.01016.57
7.3.230.0070.01116.41
7.3.210.0130.00316.68
7.3.200.0110.00516.36
7.3.190.0060.02016.42
7.3.180.0040.01116.28
7.3.170.0230.03316.39
7.3.160.0120.01216.45
7.3.120.0060.00914.86
7.3.110.0030.01414.91
7.3.100.0120.00414.81
7.3.90.0090.00314.76
7.3.80.0040.01115.03
7.3.70.0060.00314.66
7.3.60.0040.01114.66
7.3.50.0090.00314.73
7.3.40.0080.00514.74
7.3.30.0080.00914.75
7.3.20.0080.00316.50
7.3.10.0030.01316.57
7.3.00.0040.01016.48
7.2.330.0120.01216.62
7.2.320.0090.01316.79
7.2.310.0090.01316.67
7.2.300.0030.01316.71
7.2.290.0080.00816.59
7.2.250.0090.00915.21
7.2.240.0120.00615.23
7.2.230.0040.01515.14
7.2.220.0040.01214.74
7.2.210.0100.00714.94
7.2.200.0060.00915.05
7.2.190.0110.00314.95
7.2.180.0080.00514.92
7.2.170.0080.00614.74
7.2.160.0070.00715.06
7.2.150.0060.00616.75
7.2.140.0110.00417.03
7.2.130.0100.00616.96
7.2.120.0160.00016.83
7.2.110.0090.00616.75
7.2.100.0030.01116.78
7.2.90.0090.00616.79
7.2.80.0110.00416.57
7.2.70.0090.00616.76
7.2.60.0090.00316.73
7.2.50.0060.01016.82
7.2.40.0060.00616.89
7.2.30.0110.00416.76
7.2.20.0030.00916.68
7.2.10.0060.00916.84
7.2.00.0100.00316.64
7.1.330.0080.00415.63
7.1.320.0070.01015.76
7.1.310.0100.00315.48
7.1.300.0080.00315.62
7.1.290.0030.00915.61
7.1.280.0100.00115.52
7.1.270.0070.00415.72
7.1.260.0030.01315.73
7.1.250.0090.00715.63

preferences:
30.88 ms | 403 KiB | 5 Q