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         }




        $pos = \strrpos($address, ':');

        if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') {

            $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore

        }
<?php         }




        $pos = \strrpos($address, ':');

        if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') {

            $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore

        }
<?php         $address = \stream_socket_get_name($this->master, false);




        $pos = \strrpos($address, ':');

        if ($pos !== false && \strpos($address, ':') < $pos && \substr($address, 0, 1) !== '[') {

            $address = '[' . \substr($address, 0, $pos) . ']:' . \substr($address, $pos + 1); // @codeCoverageIgnore

        }