phpseclib\Net\SSH2::_array_intersect_first PHP Метод

_array_intersect_first() публичный Метод

Returns the first value of the intersection of two arrays or false if the intersection is empty. The order is defined by the first parameter.
public _array_intersect_first ( array $array1, array $array2 ) : mixed
$array1 array
$array2 array
Результат mixed False if intersection is empty, else intersected value.
    function _array_intersect_first($array1, $array2)
    {
        foreach ($array1 as $value) {
            if (in_array($value, $array2)) {
                return $value;
            }
        }
        return false;
    }