3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'Colour' => [ 'Red' => 'Red', 'Blue' => 'Blue', ], 'Size' => [ 'Small' => 'Small', 'Medium' => 'Medium', 'Large' => 'Large', ], 'Brand' => [ 'Nike' => 'Nike', 'Adidas' => 'Adidas', ], ]; $combined = []; foreach ($data['Colour'] as $colour) { foreach ($data['Brand'] as $brand) { foreach ($data['Size'] as $size) { $combined[] = implode(' - ', [ $colour, $size, $brand ]); } } } var_dump($combined);
Output for git.master, git.master_jit, rfc.property-hooks
array(12) { [0]=> string(18) "Red - Small - Nike" [1]=> string(19) "Red - Medium - Nike" [2]=> string(18) "Red - Large - Nike" [3]=> string(20) "Red - Small - Adidas" [4]=> string(21) "Red - Medium - Adidas" [5]=> string(20) "Red - Large - Adidas" [6]=> string(19) "Blue - Small - Nike" [7]=> string(20) "Blue - Medium - Nike" [8]=> string(19) "Blue - Large - Nike" [9]=> string(21) "Blue - Small - Adidas" [10]=> string(22) "Blue - Medium - Adidas" [11]=> string(21) "Blue - Large - Adidas" }

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:
26.32 ms | 407 KiB | 5 Q