3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr2 = array ( 0 => array ( 0 => 'company-group', 1 => 'index', ), 1 => array ( 0 => 'company-group', 1 => 'view', ), 2 => array ( 0 => 'company-group', 1 => 'create', ), 3 => array ( 0 => 'company-group', 1 => 'update', ), 4 => array ( 0 => 'company-group', 1 => 'delete', ), 5 => array ( 0 => 'company-industry', 1 => 'index', ), 6 => array ( 0 => 'company-industry', 1 => 'view', ), 7 => array ( 0 => 'company-industry', 1 => 'create', ), 8 => array ( 0 => 'company-industry', 1 => 'update', ), 9 => array ( 0 => 'company-industry', 1 => 'delete', ), ); Foreach($arr2 as $sub){ $new[$sub[0]]["key"] = $sub[0]; $new[$sub[0]]["val"][] = $sub[1]; } Var_dump(array_values($new));
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> array(2) { ["key"]=> string(13) "company-group" ["val"]=> array(5) { [0]=> string(5) "index" [1]=> string(4) "view" [2]=> string(6) "create" [3]=> string(6) "update" [4]=> string(6) "delete" } } [1]=> array(2) { ["key"]=> string(16) "company-industry" ["val"]=> array(5) { [0]=> string(5) "index" [1]=> string(4) "view" [2]=> string(6) "create" [3]=> string(6) "update" [4]=> string(6) "delete" } } }

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