3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = Array( Array ( 'C1', 'C1', 'C1', 'AC', 'AC' ) ); $arr2 = Array( Array( 'C1_complete', 'C1_29-95', 'C1_49-95', 'AC_complete', 'AC_29-95' ) ); $data = array_combine(array_values($arr1[0]),array_fill(0,count($arr1[0]),[])); array_walk($arr2[0],function($value) use (&$data){ if(isset($data[explode("_",$value)[0]])) $data[explode("_",$value)[0]][] = $value; }); $data = [$data]; // since you want it inside another array. print_r($data);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [C1] => Array ( [0] => C1_complete [1] => C1_29-95 [2] => C1_49-95 ) [AC] => Array ( [0] => AC_complete [1] => AC_29-95 ) ) )

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:
171.91 ms | 406 KiB | 5 Q