Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find the position of the last occurrence of a substring in a string
<?php strrpos(string $haystack, string $needle, int $offset = 0): int|false
<?php         $first = $class[0];

        if (isset($this->prefixLengthsPsr4[$first])) {

            $subPath = $class;

            while (false !== $lastPos = strrpos($subPath, '\\')) {

                $subPath = substr($subPath, 0, $lastPos);

                $search = $subPath . '\\';

                if (isset($this->prefixDirsPsr4[$search])) {
<?php         }




        if (false !== $pos = strrpos($class, '\\')) {


            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)

                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
<?php         $rejectedClasses = array();



        $realSubPath = substr($filePath, strlen($basePath) + 1);

        $dotPosition = strrpos($realSubPath, '.');

        $realSubPath = substr($realSubPath, 0, $dotPosition === false ? PHP_INT_MAX : $dotPosition);



        foreach ($classes as $class) {
<?php             }


            if ('psr-0' === $namespaceType) {

                $namespaceLength = strrpos($class, '\\');

                if (false !== $namespaceLength) {

                    $namespace = substr($class, 0, $namespaceLength + 1);

                    $className = substr($class, $namespaceLength + 1);
<?php         }



        try {

            $filename = substr($target, 0, strrpos($target, $format) - 1);




            if (isset(static::$compressFormats[$format])) {
<?php                 $class = trim($class, '\\');

                $path = $classLoader->findFile($class);

                $code = file_get_contents($path);

                $separatorPos = strrpos($class, '\\');

                $className = $class;

                if ($separatorPos) {

                    $className = substr($class, $separatorPos + 1);
<?php             $this->packagePath = '/' . trim($this->repoConfig['package-path'], '/');

        }



        if (false !== ($pos = strrpos($this->url, '/' . $this->trunkPath))) {

            $this->baseUrl = substr($this->url, 0, $pos);

        }
<?php     public function setStream($stream)

    {

        $this->p4Stream = $stream;

        $index = strrpos($stream, '/');


        if ($index > 2) {

            $this->p4DepotType = 'stream';
<?php         $first = $class[0];

        if (isset($this->prefixLengthsPsr4[$first])) {

            $subPath = $class;

            while (false !== $lastPos = strrpos($subPath, '\\')) {

                $subPath = substr($subPath, 0, $lastPos);

                $search = $subPath . '\\';

                if (isset($this->prefixDirsPsr4[$search])) {
<?php         }




        if (false !== $pos = strrpos($class, '\\')) {


            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)

                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
<?php         $first = $class[0];

        if (isset($this->prefixLengthsPsr4[$first])) {

            $subPath = $class;

            while (false !== $lastPos = strrpos($subPath, '\\')) {

                $subPath = substr($subPath, 0, $lastPos);

                $search = $subPath . '\\';

                if (isset($this->prefixDirsPsr4[$search])) {
<?php         }




        if (false !== $pos = strrpos($class, '\\')) {


            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)

                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
<?php         $scheme = 'http';



        if (strpos($url, '[') !== 0 && strrpos($url, ':') !== false) {

            list(, $port) = explode(':', $url);



            if ($port === '443') {