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 {

    public static function major()

    {

        return substr(app()->version(), 0, 1);

    }

}
<?php         if (preg_match_all($pattern, $value, $matches, PREG_OFFSET_CAPTURE)) {

            foreach (array_reverse($matches[0]) as $match) {

                $position = mb_strlen(substr($value, 0, $match[1]));



                $value = $this->insertLineNumberAtPosition($position, $value);

            }
<?php         if ($shouldInsertLineNumbers) {

            foreach (array_reverse($matches[0]) as $match) {

                $position = mb_strlen(substr($value, 0, $match[1]));



                $value = $this->insertLineNumberAtPosition($position, $value);

            }