3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = Array( Array( 'userId' => 'user1', 'name' => 'Suman Mandal', 'age' => 20, ), Array( 'userId' => 'user2', 'name' => 'Amit Halder', 'age' => 30, ), Array( 'userId' => 'user3', 'name' => 'Asif Rahman', 'age' => 25, ), Array( 'userId' => 'user4', 'name' => 'Gopal Ghosh', 'age' => 21, ) ); $marks = Array( Array( 'userId' => 'user1', 'marks'=>80, ), Array( 'userId' => 'user3', 'marks'=>90, ) ); $users = array_column($users, null, 'userId'); $marks = array_column($marks, null, 'userId'); $marks_sheet = array_replace($marks, $users); var_dump($marks_sheet);
Output for git.master_jit, git.master, rfc.property-hooks
array(4) { ["user1"]=> array(3) { ["userId"]=> string(5) "user1" ["name"]=> string(12) "Suman Mandal" ["age"]=> int(20) } ["user3"]=> array(3) { ["userId"]=> string(5) "user3" ["name"]=> string(11) "Asif Rahman" ["age"]=> int(25) } ["user2"]=> array(3) { ["userId"]=> string(5) "user2" ["name"]=> string(11) "Amit Halder" ["age"]=> int(30) } ["user4"]=> array(3) { ["userId"]=> string(5) "user4" ["name"]=> string(11) "Gopal Ghosh" ["age"]=> int(21) } }

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:
50.67 ms | 402 KiB | 8 Q