Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Get string length
<?php strlen(string $string): int
<?php     public function dispatch(string $method, string $path): DispatchResult

    {

        $lengthPath = strlen($path) - 1;




        if (false !== $pos = strpos($path, '?')) {
<?php     private function removeTrailingDelimiter(string $prefix): string

    {

        $prefixLength = strlen($prefix) - 1;

        if ($prefixLength > 0 && $prefix[$prefixLength] == self::$delimiter) {

            $prefix = $this->removeTrailingDelimiter(substr($prefix, 0, $prefixLength));

        }
<?php     private function removeRootDelimiter(string $prefix): string

    {

        if (substr($prefix, 0, 1) == self::$delimiter) {

            return $this->removeRootDelimiter(substr($prefix, 1, strlen($prefix)));

        }



        return $prefix;
<?php     public function namespace(string $namespace): RouteInterface

    {

        if ($namespace[strlen($namespace) - 1] !== "\\") {

            $namespace .= "\\";

        }

        $this->namespace = $namespace;