I know this is a 0(n) relationship, where we need to check for every single row of array for membership, but what is the fastest way to do the check?
$x = [["id" =>61, "name" => "jill"],["id" =>1, "name" => "john"],];
$y = [["id" =>89, "state" => "drunk"],["id" =>61, "state" => "sleep"]];
$z = array_values_collide($x, $y, "id");
where z should return:
$z = [["id" =>61, "name" => "jill", state => "sleep"];