src/Util/Strings.php
public static function matchAll(string $subject, string $pattern, int $flags = 0, int $offset = 0): array
    {
        if ($offset > \strlen($subject)) {
            return [];
        }

        $m = null;
        static::pcre('\preg_match_all', [
            $pattern,
            $subject,
            &$m,
            ($flags & PREG_PATTERN_ORDER) ? $flags : ($flags | PREG_SET_ORDER),
            $offset,
        ]);

        return $m;
    }
public static function matchAll(string $subject, string $pattern, int $flags = 0, int $offset = 0): array
    {
        if ($offset > \strlen($subject)) {
            return [];
        }

        $m = null;
        static::pcre('\preg_match_all', [
            $pattern,
            $subject,
            &$m,
            ($flags & PREG_PATTERN_ORDER) ? $flags : ($flags | PREG_SET_ORDER),
            $offset,
        ]);

        return $m;
    }
public static function matchAll ( string $ subject , string $ pattern , int $ flags = 0 , int $ offset = 0 ) : array { if ( $ offset > \ strlen ( $ subject ) ) { return [ ] ; } $ m = null ; static :: pcre ( '\preg_match_all' , [ $ pattern , $ subject , & $ m , ( $ flags & PREG_PATTERN_ORDER ) ? $ flags : ( $ flags | PREG_SET_ORDER ) , $ offset , ] ) ; return $ m ; }
Performs a global regular expression match.

@param  string $subject
@param  string $pattern
@param  int    $flags  can be PREG_OFFSET_CAPTURE (returned in bytes); PREG_SET_ORDER is default
@param  int    $offset offset in bytes

@return array
@throws RegexpException
Performs a global regular expression match .