Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return part of a string
<?php substr(string $string, int $offset, ?int $length = null): string
<?php             foreach (array_reverse($loadedClasses) as $loadedClass) {

                $offset = 0 - strlen($suiteClassName);



                if (stripos(substr($loadedClass, $offset - 1), '\\'.$suiteClassName) === 0 ||

                    stripos(substr($loadedClass, $offset - 1), '_'.$suiteClassName) === 0) {

                    try {

                        $class = new ReflectionClass($loadedClass);
<?php                 $offset = 0 - strlen($suiteClassName);



                if (stripos(substr($loadedClass, $offset - 1), '\\'.$suiteClassName) === 0 ||

                    stripos(substr($loadedClass, $offset - 1), '_'.$suiteClassName) === 0) {

                    try {

                        $class = new ReflectionClass($loadedClass);
<?php         $dotPos = strpos($className, '.');



        if ($dotPos !== false) {

            $className = substr($className, 0, $dotPos);

        }



        return $className;
<?php         $dotPos = strpos($basename, '.');



        if ($dotPos !== false) {

            $basename = substr($basename, 0, $dotPos);

        }



        $relativePath = dirname(ucfirst($relativePath)).DIRECTORY_SEPARATOR.$basename;
<?php         }



        if (str_starts_with($version, '>=') || str_starts_with($version, '<=')) {

            $operator = substr($version, 0, 2);

            $version = substr($version, 2);

        } elseif (str_starts_with($version, '>') || str_starts_with($version, '<')) {

            $operator = $version[0];
<?php         if (str_starts_with($version, '>=') || str_starts_with($version, '<=')) {

            $operator = substr($version, 0, 2);

            $version = substr($version, 2);

        } elseif (str_starts_with($version, '>') || str_starts_with($version, '<')) {

            $operator = $version[0];

            $version = substr($version, 1);
<?php             $version = substr($version, 2);

        } elseif (str_starts_with($version, '>') || str_starts_with($version, '<')) {

            $operator = $version[0];

            $version = substr($version, 1);


        } elseif (is_numeric($version[0])) {

            $operator = '==';
<?php         $relativePath = str_replace($this->testsPath, '', TestSuite::getInstance()->getFilename());




        $relativePath = substr($relativePath, 0, (int) strrpos($relativePath, '.'));



        $description = TestSuite::getInstance()->getDescription();
<?php         $className = (new ReflectionClass($this->target))->getName();



        if (str_starts_with($className, 'P\\')) {

            $className = substr($className, 2);

        }



        trigger_error(sprintf('Undefined property %s::$%s', $className, $property), E_USER_WARNING);
<?php     public static function random(int $length = 16): string

    {

        return substr(str_shuffle(str_repeat(self::POOL, 5)), 0, $length);

    }
<?php             return true;

        }



        return $search === substr($target, -$length);

    }
<?php             return $subject;

        }



        return substr($subject, 0, $pos);

    }
<?php         $relativePath = str_replace(DIRECTORY_SEPARATOR, '/', $relativePath);



        if (str_starts_with($relativePath, '/')) {

            $relativePath = substr($relativePath, 1);

        }



        return in_array($relativePath, $this->changedFiles, true);
<?php         $dirtyFiles = [];



        foreach ($output as $dirtyFile) {

            $dirtyFiles[substr($dirtyFile, 3)] = trim(substr($dirtyFile, 0, 3));

        }



        $dirtyFiles = array_filter($dirtyFiles, fn (string $status): bool => $status !== 'D');