3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array( array('ur_user_id'=> 1,'ur_fname'=>'PerA','ur_lname'=>'SonA'), array('ur_user_id'=> 2,'ur_fname'=>'PerB','ur_lname'=>'SonB'), array('ur_user_id'=> 3,'ur_fname'=>'PerC','ur_lname'=>'SonC'), ); $array2 = array( array('ur_user_id' => 5,'ur_code' => 'AA-BB-CC','ur_user_role' => 'testE'), array('ur_user_id' => 4,'ur_code' => 'AA-BB-CC','ur_user_role' => 'testD'), array('ur_user_id' => 6,'ur_code' => 'AA-BB-CC','ur_user_role' => 'testF'), array('ur_user_id' => 3,'ur_code' => 'AA-BB-CC','ur_user_role' => 'testC'), array('ur_user_id' => 1,'ur_code' => 'AA-BB-CC','ur_user_role' => 'testA'), array('ur_user_id' => 2,'ur_code' => 'AA-BB-CC','ur_user_role' => 'testB'), ); $ids = array(); $out = array(); foreach($array1 as $key => $value){ if(isset($array2[$key])) $out[$key][] = $array2[$key]; $out[$key][] = $value; $ids[] = $array2[$key]['ur_user_id']; } foreach($array2 as $key => $val){ if(!in_array($val['ur_user_id'], $ids)) $out[$key][] = $array2[$key]; } print_r($out);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => Array ( [ur_user_id] => 5 [ur_code] => AA-BB-CC [ur_user_role] => testE ) [1] => Array ( [ur_user_id] => 1 [ur_fname] => PerA [ur_lname] => SonA ) ) [1] => Array ( [0] => Array ( [ur_user_id] => 4 [ur_code] => AA-BB-CC [ur_user_role] => testD ) [1] => Array ( [ur_user_id] => 2 [ur_fname] => PerB [ur_lname] => SonB ) ) [2] => Array ( [0] => Array ( [ur_user_id] => 6 [ur_code] => AA-BB-CC [ur_user_role] => testF ) [1] => Array ( [ur_user_id] => 3 [ur_fname] => PerC [ur_lname] => SonC ) ) [3] => Array ( [0] => Array ( [ur_user_id] => 3 [ur_code] => AA-BB-CC [ur_user_role] => testC ) ) [4] => Array ( [0] => Array ( [ur_user_id] => 1 [ur_code] => AA-BB-CC [ur_user_role] => testA ) ) [5] => Array ( [0] => Array ( [ur_user_id] => 2 [ur_code] => AA-BB-CC [ur_user_role] => testB ) ) )

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:
122.27 ms | 411 KiB | 5 Q