3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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_diff_key($marks, array_replace($marks, $users)); var_dump($marks_sheet);
Output for 7.3.0rc3
array(0) { }