Findings

sebastianbergmann/phpunit

1 regex finding: 1 FAIL, 0 WARN judged for PHP 8.5.12 · PCRE2 10.44 code as of 2026-12-04

1 regex issue in sebastianbergmann/phpunit

The regexes of sebastianbergmann/phpunit, linted for its own PHP version. Open a finding to replay it here.

    Sample · press Run
    sebastianbergmann on GitHubsebastianbergmann/phpunitView on GitHub at 52a679a

    Judged for PHP 8.5.12PCRE2 10.44composer.json config.platform.php · code as of 2026-12-04

    build/scripts/phar-manifest.php:666 · preg_match()

    663 */664function isPlatformPackage(string $name): bool665{666    return preg_match('{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer(?:-(?:plugin|runtime)-api)?)$}iD', $name) === 1;667}668669function writeDependency(XMLWriter $writer, string $ref, array $dependsOn): void
    • FAILExponential backtracking (proven). Severity: CRITICAL, confidence: HIGH.Attack: "EXT-0" . "-00" x n . "!" Replayed on PCRE2 10.49: preg_match fails from length 51 (backtrack_limit 100000, JIT off). The risky part is: [a-z0-9]+ Hotspot offsets: 71-80 Unbounded quantifier detected. May cause backtracking on non-matching input. Consider making it possessive (*+) or using atomic groups (?>...). Nested unbounded quantifiers detected. This allows exponential backtracking. Consider using atomic groups (?>...) or possessive quantifiers (*+, ++). Suggested (verify behavior): Consider using possessive quantifiers or atomic groups to limit backtracking. Suggested (verify behavior): Replace inner quantifiers with possessive variants or wrap them in (?>...). Test with adversarial inputs like repeated strings followed by a non-matching character.regex.lint.redos
    • WARNNested quantifiers in "(?:[_.-]?[a-z0-9]+)" at offset 62 can cause catastrophic backtracking.Consider atomic groups (?>...) or possessive quantifiers — verify the rewrite still matches everything you need.regex.lint.quantifier.nested

    Witness: "EXT-0" + "-00" × 60 + "!"

    Replayed on PCRE2 10.49 (JIT off, backtrack limit 100000): preg_match() gives up from length 51.

    Point at a node, or at a piece of the pattern; the arrow keys walk the tree.

    
            

      Point at a node to read it.

        Nothing you type leaves your browser

        Runs on php-wasm (Apache-2.0) with mbstring and oniguruma (BSD), loaded from jsDelivr when you press Run; PHP 8.6, which php-wasm does not publish yet, is built from its sources and served by this site. The Step through tab traces the match with PCRE2 itself (BSD-3-Clause), the release the chosen PHP bundles, compiled to WebAssembly as PHP bundles it.

        1 finding

        What the linter reports on the code at the commit named above. A finding opens in the tool.

        1. FAILbuild/scripts/phar-manifest.php:666Replay

          {^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer(?:-(?:plugin|runtime)-api)?)$}iD