public static function exists($arrayOrArrayAccess, $keyOrOffset)
    {
        if ($arrayOrArrayAccess instanceof ArrayAccess) {
            return $arrayOrArrayAccess->offsetExists($keyOrOffset);
        }

        return array_key_exists($keyOrOffset, $arrayOrArrayAccess);
    }