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;
    }