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' => 'EE','ur_user_role' => 'testE'), array('ur_user_id' => 4,'ur_code' => 'DD','ur_user_role' => 'testD'), array('ur_user_id' => 6,'ur_code' => 'FF','ur_user_role' => 'testF'), array('ur_user_id' => 3,'ur_code' => 'CC','ur_user_role' => 'testC'), array('ur_user_id' => 1,'ur_code' => 'AA','ur_user_role' => 'testA'), array('ur_user_id' => 2,'ur_code' => 'BB','ur_user_role' => 'testB'), ); $keyed = array_column($array2, NULL, 'ur_user_id'); foreach ($array1 as &$row) { if (isset($keyed[$row['ur_user_id']])) { $row += $keyed[$row['ur_user_id']]; } } var_export($array1);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'ur_user_id' => 1, 'ur_fname' => 'PerA', 'ur_lname' => 'SonA', 'ur_code' => 'AA', 'ur_user_role' => 'testA', ), 1 => array ( 'ur_user_id' => 2, 'ur_fname' => 'PerB', 'ur_lname' => 'SonB', 'ur_code' => 'BB', 'ur_user_role' => 'testB', ), 2 => array ( 'ur_user_id' => 3, 'ur_fname' => 'PerC', 'ur_lname' => 'SonC', 'ur_code' => 'CC', 'ur_user_role' => 'testC', ), )

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