3v4l.org

run code in 300+ PHP versions simultaneously
<?php $categorizedOptions = [ 'category' => [ '1' => [ 'name' => 'c1', 'attribute' => [ '1' => [ 'name' => 'a1', 'option' => [ '1' => [ 'name' => 'o1' ], '2' => [ 'name' => 'o2' ] ] ], '2' => [ 'name' => 'a2', 'option' => [ '3' => [ 'name' => 'o3' ], '4' => [ 'name' => 'o4' ] ] ] ] ], '2' => [ 'name' => 'c2', 'attribute' => [ '3' => [ 'name' => 'a3', 'option' => [ '5' => [ 'name' => 'o5' ], '6' => [ 'name' => 'o6' ] ] ], '4' => [ 'name' => 'a4', 'option' => [ '7' => [ 'name' => 'o7' ], '8' => [ 'name' => 'o8' ] ] ] ] ] ] ]; $final = []; foreach ($categorizedOptions as $categories) { foreach ($categories as $category => ['name' => $categoryname, 'attribute' => $attributes]) { foreach ($attributes as $attribute => ['name' => $attributename, 'option' => $options]) { foreach ($options as $option => ['name' => $optionname]) { $final[] = compact(['category', 'categoryname', 'attribute', 'attributename', 'option', 'optionname']); } } } } var_export($final);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'category' => 1, 'categoryname' => 'c1', 'attribute' => 1, 'attributename' => 'a1', 'option' => 1, 'optionname' => 'o1', ), 1 => array ( 'category' => 1, 'categoryname' => 'c1', 'attribute' => 1, 'attributename' => 'a1', 'option' => 2, 'optionname' => 'o2', ), 2 => array ( 'category' => 1, 'categoryname' => 'c1', 'attribute' => 2, 'attributename' => 'a2', 'option' => 3, 'optionname' => 'o3', ), 3 => array ( 'category' => 1, 'categoryname' => 'c1', 'attribute' => 2, 'attributename' => 'a2', 'option' => 4, 'optionname' => 'o4', ), 4 => array ( 'category' => 2, 'categoryname' => 'c2', 'attribute' => 3, 'attributename' => 'a3', 'option' => 5, 'optionname' => 'o5', ), 5 => array ( 'category' => 2, 'categoryname' => 'c2', 'attribute' => 3, 'attributename' => 'a3', 'option' => 6, 'optionname' => 'o6', ), 6 => array ( 'category' => 2, 'categoryname' => 'c2', 'attribute' => 4, 'attributename' => 'a4', 'option' => 7, 'optionname' => 'o7', ), 7 => array ( 'category' => 2, 'categoryname' => 'c2', 'attribute' => 4, 'attributename' => 'a4', 'option' => 8, 'optionname' => 'o8', ), )

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:
112.88 ms | 409 KiB | 5 Q