public function isReserved(string $slug): bool
    {
        $slug = mb_strtolower($slug);
        $slug = str_replace(['-', '_', '.'], '', $slug);

        if (($is = &$this->cacheKey(__FUNCTION__, $slug)) !== null) {
            return $is; // Cached this already.
        }
        if (mb_strlen($slug) < 3) {
            return $is = true;
        } elseif (in_array($slug, $this::SLUG_RESERVED_STRINGS, true)) {
            return $is = true;
        }
        foreach ($this::SLUG_RESERVED_REGEX_FRAGS as $_regex_frag) {
            if (preg_match('/^'.$_regex_frag.'$/ui', $slug)) {
                return $is = true;
            }
        } // unset($_regex_frag); // Housekeeping.

        return $is = false;
    }
public function isReserved(string $slug): bool
    {
        $slug = mb_strtolower($slug);
        $slug = str_replace(['-', '_', '.'], '', $slug);

        if (($is = &$this->cacheKey(__FUNCTION__, $slug)) !== null) {
            return $is; // Cached this already.
        }
        if (mb_strlen($slug) < 3) {
            return $is = true;
        } elseif (in_array($slug, $this::SLUG_RESERVED_STRINGS, true)) {
            return $is = true;
        }
        foreach ($this::SLUG_RESERVED_REGEX_FRAGS as $_regex_frag) {
            if (preg_match('/^'.$_regex_frag.'$/ui', $slug)) {
                return $is = true;
            }
        } // unset($_regex_frag); // Housekeeping.

        return $is = false;
    }
public function isReserved ( string $ slug ) : bool { $ slug = mb_strtolower ( $ slug ) ; $ slug = str_replace ( [ '-' , '_' , '.' ] , '' , $ slug ) ; if ( ( $ is = & $ this -> cacheKey ( __FUNCTION__ , $ slug ) ) !== null ) { return $ is ; // Cached this already. } if ( mb_strlen ( $ slug ) < 3 ) { return $ is = true ; } elseif ( in_array ( $ slug , $ this :: SLUG_RESERVED_STRINGS , true ) ) { return $ is = true ; } foreach ( $ this :: SLUG_RESERVED_REGEX_FRAGS as $ _regex_frag ) { if ( preg_match ( '/^' . $ _regex_frag . '$/ui' , $ slug ) ) { return $ is = true ; } } // unset($_regex_frag); // Housekeeping. return $ is = false ; }
Is slug reserved?

@since 150424 Reserved slugs.

@param string $slug Slug.

@return bool True if slug is reserved.
Is slug reserved?