src/Util.php
public static function exists($arr, $key) {
        // If it's an object, index directly because array_key_exists doesn't
        // work with the ArrayAccess interface. Otherwise, check if it implements
        // ArrayAccess and fall back to array_key_exists.
        if(is_object($arr)) {
            return $arr->offsetExists($key);
        }
        if(is_array($arr)) {
            return array_key_exists($key, $arr);
        }

        return false;
    }
public static function exists($arr, $key) {
        // If it's an object, index directly because array_key_exists doesn't
        // work with the ArrayAccess interface. Otherwise, check if it implements
        // ArrayAccess and fall back to array_key_exists.
        if(is_object($arr)) {
            return $arr->offsetExists($key);
        }
        if(is_array($arr)) {
            return array_key_exists($key, $arr);
        }

        return false;
    }
public static function exists ( $ arr , $ key ) { // If it's an object, index directly because array_key_exists doesn't // work with the ArrayAccess interface. Otherwise, check if it implements // ArrayAccess and fall back to array_key_exists. if ( is_object ( $ arr ) ) { return $ arr -> offsetExists ( $ key ) ; } if ( is_array ( $ arr ) ) { return array_key_exists ( $ key , $ arr ) ; } return false ; }
Determines whether an array contains a certain key.
@param array|\ArrayAccess $arr The array.
@param string|int $key The key.
@return bool true if the key exists and false otherwise.
Determines whether an array contains a certain key .