There are two arrays with names. Write in the third array the names that are the same from the first and second array.
Array( [0] => stdClass Object ( [login] => serg123 ) [1] => stdClass Object ( [login] => turb0 ) )
Array( [0] => stdClass Object ( [login] => Maksim ) [1] => stdClass Object ( [login] => turb0 ) )
in the third array should be
Array( [0] => stdClass Object ( [login] => turb0 )