3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = [1, 2, 3, 4, 5]; $vendors = ["Amazon", "Newegg", "##php"]; $combinations = []; foreach ($vendors as $vendor) { foreach ($products as $productID) { $combinations[] = array('product' => $productID, 'vendor' => $vendor); } } var_dump($combinations);
Output for git.master, git.master_jit, rfc.property-hooks
array(15) { [0]=> array(2) { ["product"]=> int(1) ["vendor"]=> string(6) "Amazon" } [1]=> array(2) { ["product"]=> int(2) ["vendor"]=> string(6) "Amazon" } [2]=> array(2) { ["product"]=> int(3) ["vendor"]=> string(6) "Amazon" } [3]=> array(2) { ["product"]=> int(4) ["vendor"]=> string(6) "Amazon" } [4]=> array(2) { ["product"]=> int(5) ["vendor"]=> string(6) "Amazon" } [5]=> array(2) { ["product"]=> int(1) ["vendor"]=> string(6) "Newegg" } [6]=> array(2) { ["product"]=> int(2) ["vendor"]=> string(6) "Newegg" } [7]=> array(2) { ["product"]=> int(3) ["vendor"]=> string(6) "Newegg" } [8]=> array(2) { ["product"]=> int(4) ["vendor"]=> string(6) "Newegg" } [9]=> array(2) { ["product"]=> int(5) ["vendor"]=> string(6) "Newegg" } [10]=> array(2) { ["product"]=> int(1) ["vendor"]=> string(5) "##php" } [11]=> array(2) { ["product"]=> int(2) ["vendor"]=> string(5) "##php" } [12]=> array(2) { ["product"]=> int(3) ["vendor"]=> string(5) "##php" } [13]=> array(2) { ["product"]=> int(4) ["vendor"]=> string(5) "##php" } [14]=> array(2) { ["product"]=> int(5) ["vendor"]=> string(5) "##php" } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.09 ms | 404 KiB | 8 Q