Backward Compatibility Promise
PHPRegex follows semantic versioning. Every package of
the family (php-regex/regex-*) is released together, with one version number,
and each requires its siblings at exactly its own version (Composer’s
self.version): you never compute a compatibility matrix between them. Install
and update them together, with composer update 'php-regex/*'; Composer refuses
a partial update.
Nothing matches that filter — try a shorter fragment, or press Escape to see the whole page again.
This page says what a minor release (2.1, 2.2, …) and a patch release (2.0.1, …) may change, and what only the next major release (3.0) may change.
What the promise covers
Every class, interface, trait and enum not marked @internal, with its
public methods, public properties and public constants. A class marked
@internal is not part of the API: it may change in any release.
Some @internal classes and constructors are shared between packages. They
may change in any release, since siblings always run at the same version (each
package requires its siblings at self.version). Code outside this project must
not use them. Within the project, which package may use which @internal
class of a sibling is a closed list, checked on every change: a new
dependency on one is a decision, not a side effect of an import. The tag, not
the namespace, marks a class internal, so making one public removes the tag
and leaves the class where it is.
The PHPRegex\Parser\Hir classes of regex-parser are @internal like the
rest: regex-automata and regex-redos, which build on them, move with them.
Result objects are built by the library. Their class, methods and properties
are public, but their constructors are @internal: read them, never build
them. A minor release may add a constructor parameter, required or not. If a
test of your own code needs one, get it from the producer on a known pattern,
for example LanguageSolver::equivalent() for an EquivalenceResult or
RedosAnalyzer::analyze() for a RedosAnalysis. The result objects are:
regex-parser:TolerantParseResult,Validation\ValidationResult,Analysis\GroupNumbering,Analysis\LiteralExtractionResult,Analysis\CaptureShape,Analysis\CaptureGroupShape,Engine\PcreMatch,Engine\PcreError,Analysis\PatternInfo,Validation\PatternCompatibility,Validation\TargetVerdict,Validation\RangeVerdict;regex-optimizer:OptimizationResult,RedosRepair;regex-automata:Solver\EquivalenceResult,Solver\IntersectionResult,Solver\SubsetResult,Solver\MatchEquivalenceResult,Language,TrivialMatch,Ordered\FirstMatchCell;regex-redos:RedosAnalysis,Finding,Hotspot,RedosWitness,RedosSearchCost,Confirmation,ConfirmationSample;regex-transpiler:TranspileResult;regex-linter:Rule\RuleViolation;regex-toolkit:AnalysisReport.
@internal still means removable. The 2.0.0 release removed Automata\Alphabet\CharSet
(use Parser\Hir\CharSet) and the AST-walking transformer behind the solver
(now Transform\HirToNfaTransformer); UPGRADE-2.0.md
maps every removed name.
Packages and the facade
The packages are the contract: each one’s public classes, listed below, are
what this promise covers. PHPRegex\Toolkit\Regex is a convenience layer over
seven of them (parser, explain, generator, linter, optimizer, ReDoS and
transpiler): its methods are public and covered like any other, but it gives
the calls an application needs most, not everything the packages offer. Reach
for a package directly when the facade has no method for it; to compare two
patterns, for instance, use LanguageSolver from regex-automata, which the
facade does not wrap.
In short, the public surface is:
| package | public |
|---|---|
regex-parser |
RegexParser, Attribute\RegexPattern, ParserOptions, PcreTarget, PcreFeature, ErrorCode, DelimitedPattern, TolerantParseResult, NodeVisitorInterface, AbstractNodeVisitor, AbstractTraversingVisitor, NodeFinder, Token\Token, Token\TokenType, Validation\ValidationResult, Validation\ValidationErrorCategory, Printer\PatternPrinter, Printer\NodeDumper, Printer\JsonDumper, Printer\PatternFormatter, Printer\FormatResult, Printer\FormatRefusal, Analysis\ComplexityScorer, Analysis\GroupNumbering, Analysis\GroupNumberingCollector, Analysis\LengthRangeCalculator, Analysis\LiteralExtractor, Analysis\LiteralExtractionResult, Analysis\LiteralConfidence, Analysis\LiteralSet, Analysis\MetricsCollector, Analysis\CaptureShapeAnalyzer, Analysis\CaptureShape, Analysis\CaptureGroupShape, Analysis\Participation, Analysis\RequiredLiteralAnalyzer, Analysis\InertCommitments, Analysis\PatternInfoAnalyzer, Analysis\PatternInfo, NewlineConvention, BsrConvention, Validation\CompatibilityChecker, Validation\PatternCompatibility, Validation\TargetVerdict, Validation\RangeDiff, Validation\RangeVerdict, Cache\CacheInterface, Cache\RemovableCacheInterface, Cache\ArrayCache, Cache\NullCache, Cache\FilesystemCache, Cache\PsrCacheAdapter, Cache\PsrSimpleCacheAdapter, Engine\PcreEngine, Engine\PcreError, Engine\PcreLimits, Engine\PcreMatch, Exception\ExceptionInterface, Exception\RegexException, Exception\LexerException, Exception\ParserException, Exception\SyntaxErrorException, Exception\SemanticErrorException, Exception\LimitException, Exception\RecursionLimitException, Exception\ResourceLimitException, Exception\InvalidRegexOptionException, Exception\CacheException, Exception\InternalFailureException, Exception\FormattingException, Exception\JsonEncodingException, Exception\VisualContextInterface, Node\* |
regex-explain |
TextExplainer, HtmlExplainer, AsciiTreeRenderer, MermaidRenderer, RailroadSvgRenderer, Highlighter\ConsoleHighlighter, Highlighter\HtmlHighlighter |
regex-optimizer |
Optimizer, OptimizerOptions, OptimizationResult, Modernizer, RedosRepairer, RedosRepair |
regex-generator |
SampleGenerator, TestCaseGenerator, Exception\SampleGenerationException |
regex-infection |
Mutator\RegexQuantifier, Mutator\RegexAnchor, Mutator\RegexCharClass, Mutator\RegexAlternation, Mutator\RegexFlag, Mutator\RegexEscape |
regex-automata |
LanguageSolver, Options\SolverOptions, Options\MatchMode, Options\SolverStrategy, Determinization\DeterminizationAlgorithm, Minimization\MinimizationAlgorithm, Solver\EquivalenceResult, Solver\IntersectionResult, Solver\SubsetResult, Solver\MatchEquivalenceResult, Model\Dfa, Model\DfaState, Solver\DfaCacheInterface, Solver\InMemoryDfaCache, Exception\ComplexityException, Exception\IncompatibleArgumentException, TrivialMatchClassifier, TrivialMatch, TrivialMatchKind, Language, Ordered\FirstMatchPartition, Ordered\FirstMatchCell |
regex-redos |
RedosAnalyzer, RedosAnalysis, RedosOptions, RedosSeverity, RedosComplexity, RedosProof, RedosWitness, RedosSearchCost, RedosMode, RedosConfidence, Finding, Hotspot, Confirmation, ConfirmationSample, ConfirmationOptions, ConfirmationRunner, ConfirmationRunnerInterface, IgnoreList |
regex-transpiler |
Transpiler, TranspileOptions, TranspileResult, Exception\TranspileException, Target\JavaScript\VModeCompatibility |
regex-linter |
PatternLinter, LintSeverity, Exception\LintException, Rule\RuleViolation, Exception\UnknownLintRuleException, Exception\UnsupportedTargetException, Extraction\ExtractorInterface, PatternOccurrence |
regex-toolkit |
Regex, AnalysisReport, ExplainFormat, HighlightFormat |
regex-phpstan |
RegexPatternRule, RegexPatternArgumentRule |
regex-phpunit |
RegexAssertions, Constraint\MatchesPattern, Constraint\DoesNotMatchPattern, Constraint\CompilesPattern, Constraint\IsLinearPattern |
regex-psalm |
Plugin |
regex-rector |
PregMatchToStringComparisonRector, PregReplaceToStrReplaceRector, PregSplitToExplodeRector, EscapeLiteralBraceRector, AlphabeticAssertionToClassicRector, EscapeNulByteRector, PossessiveRepeatOnceRector, Set\RegexSetList |
regex-symfony |
PHPRegexSymfonyBundle, Validator\Constraints\ValidRegex, Validator\Constraints\ValidRegexValidator |
regex-laravel |
PHPRegexServiceProvider, Facades\Regex, Rules\ValidRegex |
regex-cli |
no PHP class is public |
regex-language-server |
no PHP class is public |
regex-mcp |
Application, ToolCatalog, ToolDefinition, ToolInterface, ToolResult, ServerInterface, Exception\ExceptionInterface, Exception\UnknownToolException, Exception\TargetException |
Each path is relative to the package namespace: Analysis\CaptureShape in
regex-parser is PHPRegex\Parser\Analysis\CaptureShape. Node\* is every
class of Node\.
In regex-parser, NodeVisitorInterface, AbstractNodeVisitor and
AbstractTraversingVisitor are the visitor base classes. NewlineConvention
and BsrConvention are the enums of Analysis\PatternInfo. Analysis\ByteCharSet,
Analysis\CharSetAnalyzer and Cache\AstSerializer are not public, nor is any
other class of those namespaces left out of the row.
In regex-automata, Determinization\DeterminizationAlgorithm and
Minimization\MinimizationAlgorithm are the two algorithm enums.
Model\DfaState is read through $id, $isAccepting, transitionFor(),
rangeCount() and ranges(), each range as its first code point, its last
and its target; how a state holds its moves is not covered. The promise
covers TrivialMatchClassifier::matchedLiteral() with classify(): a minor
release may prove more patterns than the one before, and its CHANGELOG says so.
LanguageSolver::matchEquivalentIn(), runsOfEveryCall(), readAlike(),
rewritesAlikeInPlace() and dfaCacheKey(), and DfaState::packedRanges()
and byteTransitions(), are @internal: the checks the optimizer and the
linter ask of a rewrite, the key a DFA is stored under, and the moves the
minimizers read. They stay on the public classes because the packages that
ask them may use no internal class of regex-automata.
In regex-redos, the promise covers RedosAnalyzer::ANALYSIS_VERSION,
RedosAnalysis::isProvenSafe() and headline(), RedosSeverity::rank(), and
Confirmation::wasSkipped() and Confirmation::LIMITS_UNAVAILABLE.
isProvenSafe() and headline() speak of one match attempt: a pattern whose
unanchored search is quadratic stays safe (proven), and carries that cost in
RedosAnalysis::$searchCost, a RedosSearchCost (null when no witness was
found, never a proof of a linear search). A pattern whose search is quadratic
only in the functions that look for every match, through PHP’s retry after an
empty match, carries that cost in RedosAnalysis::$everyMatchSearchCost
instead, and $searchCost stays null.
The bridges and tools carry more than their classes:
regex-phpstan: thephpRegexparameters ofextension.neon.regex-psalm: theInvalidRegexPatternissue name and the plugin’s<phpVersion>and<pcreVersion>options stay for all of 2.x. The$matchestypes follow the capture shape: a minor release may type a pattern more narrowly than the one before, which may require regenerating a Psalm baseline; its CHANGELOG says so.regex-rector: the rules keep their names for all of 2.x and take no configuration, andRegexSetList::STRING_FUNCTIONS,RegexSetList::PCRE_UPGRADEandRegexSetList::UPGRADE_2_0name the sets that register them. Each rewrites only what the automata prove; a minor release may prove more calls than the one before, and its CHANGELOG says so.regex-symfony: thephp_regexconfiguration, the commands’ names and options, theregex:analyzeJSON report (every key), and theValidRegexconstraint’s options, message parameters and error codes.regex-laravel: theRegexfacade (Facades\Regex) — its@methodlines mirror every public method ofRegex, so a signature that changes in the code changes there in the same release — thephp-regexconfiguration, the commands’ names and options, theregex:routesandregex:compareJSON reports (every key), and theValidRegexrule’s options.regex-cli: theregexcommand, with its commands, options, exit codes and JSON output (every key).regex-language-server: the protocol it speaks.regex-mcp: the tools’ names, arguments and the documents they answer (every key), and the classes above. Themcp/sdkconstraint is not covered: the SDK is experimental, pinned to the minors the server is tested with, and a minor release of PHPRegex may add the SDK’s next minor to the pin or drop the oldest.
Using the API: call, extend, implement
Calling a public method, reading a public property, catching a public exception and type-hinting against a public class or interface are covered.
Extending and implementing are covered only where the API is meant for it:
- Extend
AbstractNodeVisitororAbstractTraversingVisitorto write a visitor. ImplementingNodeVisitorInterfacedirectly is not covered: a minor release may add a method to it for a new node, and the abstract classes provide that method for you. - Implement
CacheInterfaceorRemovableCacheInterfaceto bring your own AST cache, andDfaCacheInterfacefor your own DFA cache. - Implement
Extraction\ExtractorInterfaceinregex-linterto read the patterns of calls the built-in extractors do not know, and build each occurrence withPatternOccurrence::found(). The constructor ofPatternOccurrenceand its other methods are@internal; read an occurrence through$pattern,$file,$line,$columnand$source.
Every other public interface (NodeInterface, ConfirmationRunnerInterface, …)
is there to type against, not to implement. Lint rules, transpiler targets and
pattern sources are not extension points in 2.0: there is no public registry to
add one to yet.
What a minor release may change
- New node types, with the matching
visitX()method onNodeVisitorInterfaceand its default in the abstract visitors. - New enum cases, in
ErrorCode,TokenType,PcreFeature,GroupTypeand the others. Amatchover one of these enums needs adefaultarm. A newAnalysis\Participationcase only refinesMayBeUnset, so adefaultarm that answersMayBeUnsetstays sound. - New optional parameters: a node constructor or a method may gain a trailing parameter with a default value. Pass arguments by position for the ones you set, or by name.
- New classes, methods and options, and new keys in a configuration file.
- How a pattern splits into tokens:
tokenize()promises tokens in source order that cover the pattern body, each with its type, its text and its byte offsets, the end-of-pattern token last. A run of literal characters, one token per character today, may become one token. - New keys and values in the JSON output: a key in any JSON document the
regexcommand or a bridge command prints, an optional key in the error envelope, and a value of an open enum field, such asstageorseverity. The JSON output reference lists what may change and which fields are open. - Message texts: an error or lint message may be reworded, in the console
and in JSON alike; the CHANGELOG says so. Match on the error code, the
issue_idor thestage, not on the message. - Support for a new PCRE2 release, as
PcreFeaturecases and the targets that use them. - A wider ReDoS model: a construct the structural heuristics judge today
(a backreference, a conditional, a non-atomic lookaround, …) may become
proven, and an ambiguity listed as without witness may get one, with
RedosAnalyzer::ANALYSIS_VERSIONraised. Their patterns move fromproof: heuristictoproof: proven, and their severity may move with them. The heuristic lint issues (nested quantifiers, dot-star in a quantifier, overlapping character sets) are dropped for a pattern the analysis proves linear, so they may disappear for a pattern the wider model now proves. - A narrower capture shape: the facts of
CaptureShapeAnalyzerand the stringsCaptureShape::matchShape()andCaptureShape::matchAllShape()write may become more precise, still holding every$matchesPHP writes, and either string may be written differently for the same type.CaptureShapeAnalyzer::ANALYSIS_VERSIONrises with any such change, and a patch may widen an answer to make it sound again. A PHPStan baseline that prints the type may need regenerating; the CHANGELOG says when. See Capture Shapes. - Narrower pattern info: the sound bounds of
Analysis\PatternInfo,minMatchLength,maxMatchLength,maxLookbehind,anchoredStart,anchoredEnd,alwaysMatchesandalwaysMatchesFromAnyOffset, may become more precise, still holding for every match PCRE2 makes: a length range may tighten, and an anchor or a sure match may become proven.PatternInfoAnalyzer::ANALYSIS_VERSIONrises with any such change, and a patch may widen an answer to make it sound again. The exact facts (captureCount,names,maxBackreference,usesBackslashC, the limits,newlineandbsr) equal PCRE2’s: a difference is a bug, fixed in a patch. See Pattern Info. - A wider compatibility matrix:
Validation\CompatibilityCheckerjudges every PHP version a rule of the library changes at, with every PCRE2 release it knows. Each PHP or PCRE2 release the library learns adds points, so the number of verdictsPatternCompatibility::verdicts()lists may grow, andisValidEverywhere()may turn false for a pattern a new point refuses.regex lintvalidates over the same points when it reads the PHP range ofcomposer.json, so a new point may fail a project that passed. See Pattern Info. - More PHP version boundaries:
PcreTarget::phpVersionBoundaries()lists the PHP versions at which a verdict of the library may change. It grows in a minor release, when the library learns a PHP release or a rule that changes at a PHP version, and the compatibility matrix and the lint range grow with it. - New ReDoS options: a configuration key for the analysis budget may be added; none is removed.
- What a lint rule reports: a rule may report more or fewer patterns when its analysis reads a case it missed, and the CHANGELOG names the rule. A patch only removes a false positive.
- Which patterns are read: a minor release may read patterns the lint, the language server, the bridges or the PHPStan extension did not read before: a new preset, a call kind, a pattern reached through a name. More patterns read means more findings on unchanged code; the CHANGELOG says what is read that was not. A preset a minor adds is on by default, unless your configuration lists its presets: a list means exactly that list.
- Deprecations: anything removed in 3.0 is deprecated in a 2.x minor first,
with the replacement named. A deprecated class, method, option or
configuration key carries
@deprecated since <package> <version>, use <replacement>and raises a silencedE_USER_DEPRECATEDnotice when it is used, worded as Symfony’strigger_deprecation()words one:Since php-regex/regex-parser 2.1: … use … instead.It keeps working for the rest of 2.x. Symfony’s deprecation handler and PHPUnit’s--display-deprecationslist these notices, so a project finds them before 3.0 removes the element.
What stays for all of 2.x
- The names of the exported type aliases (
CacheStats,LengthRange,Metrics,OptionsArray,WitnessArray, …): a@phpstan-import-typeline in your code resolves for all of 2.x. An alias has no deprecation mechanism — a rename would break importing code with no warning — so names are frozen outright. The API reference lists them. - The values of
ErrorCode(regex.group.unclosed, …) and the identifiers the PHPStan extension reports (regex.invalidForTarget,regex.redos,regex.redos.search, …), with the lint issue ids (regex.lint.redos,regex.lint.redos.search, …): baselines and ignore lists keep working. - The text of the PHPStan ReDoS messages:
Exponential backtracking (ReDoS): %s,Polynomial backtracking (ReDoS): %sandPotential backtracking (ReDoS): %s, and the one of a quadratic unanchored search,Quadratic search (ReDoS): %sunderregex.redos.search, followed by the pattern. The severity, the proof and the attack are in the tip, which may change. Which patterns get an error is not frozen: when the analysis improves, an error may appear, disappear or move to another class (Exponential, Polynomial, Potential). Regenerate the baseline after an upgrade that changes the analysis; the CHANGELOG says when one does. - The configuration keys of
regex.json, of the Symfony bundle, of the Laravel config file and of the PHPStan extension, and the exit codes of every command (0 done, 1 a pattern or file problem, 2 a usage or configuration error). A command that reads one pattern also exits with 1 when a later version of a range named with--php-versionrefuses a pattern the floor accepts. - The names of the extraction presets (
composer-pcre,nette-utils,spatie-regex,illuminate-support,phpunit,webmozart-assert,beberlei-assert,symfony-validator): a preset may read more calls of its library in a minor release, never lose its name. - The JSON output of the
regexcommand: a key keeps its name, its type and its meaning, and a success document never gains a top-levelerror(see JSON output). The ReDoS analysis’search_costandevery_match_search_cost, eachnullor{degree, witness: {prefix, run, breaker}, replayed}, are among them. - The tree’s JSON export,
JsonDumperandast.schema.json: within aversion, a key keeps its name, its type and its meaning, and a node kind keeps itstypename. A minor release may add keys and node kinds, the ones a new PCRE2 construct needs. - The severity of the lint rules: a minor never raises an existing rule to
error severity, the one that fails
regex lint, and a new rule lands at warning severity or lower. - The pattern in the machine reports: the JSON, Checkstyle and JUnit
reports of
regex lintcarry each pattern as it is written, with only what their format cannot hold spelled as an escape, so a tool can match a result to its source. The console and GitHub reports show a display form that reads back as the same pattern; that console form may be refined. The PHPStan messages show it cut after 50 characters, and that rendering stays: a baseline written for 2.0 keeps matching. - The
regex lintbaseline file: a baseline generated by 2.0 is read by every 2.x, and an issue it records stays matched when its line or its message changes. - The PHP floor, PHP 8.1, for every package: no 2.x release raises it. The Symfony bundle supports Symfony 6.4, 7.4 and 8, the Laravel integration Laravel 10.37 to 13; a minor release may drop a framework release its maintainers no longer support. Laravel 10 and 11 carry a security advisory fixed in no release of theirs (CVE-2026-48019, PKSA-mdq4-51ck-6kdq), which Composer refuses to install by default unless the application allows it.
What a patch release may change
A patch release fixes bugs. A pattern the library judged differently from PHP’s PCRE2 for the same release is a bug: its fix ships in a patch even though it changes a verdict, an error code or an offset, and the CHANGELOG lists it.
The same holds for the ReDoS model. safe (proven) promises that the model
holds no ambiguity; a pattern given that verdict on which the running engine
exhausts its backtrack limit in one match attempt is a soundness bug. Its fix
ships in a patch, with RedosAnalyzer::ANALYSIS_VERSION raised, even though
it changes a severity, and may move the pattern to proof: heuristic.
What only the next major release may change
3.0 may change anything this page does not promise:
- code marked
@internal, which may already change in any release (see What the promise covers); - the constructors of the result objects,
@internaltoday — read them, never build them; - any name the tables above leave out. 2.0 itself removed names when the
@internalsurface changed; UPGRADE-2.0.md maps every one of them, and 3.0 ships the same kind of map.
Nothing promised disappears silently: anything removed from the promised surface in 3.0 is deprecated in a 2.x minor first, with the replacement named (see Deprecations).
Which PCRE2 a behaviour needs
The library runs wherever PHP 8.1 runs, whatever PCRE2 that build links. The
behaviours below exist only from the release named: the library reads them for
a target that has the release, and the test suite verifies each row against a
real engine that does. Ubuntu 24.04 links PCRE2 10.42 into its PHP packages,
and PHP bundles 10.32 (7.3), 10.33 (7.4.0), 10.35 (8.0), 10.39 (8.1.1), 10.40 (8.2), 10.42 (8.3) and 10.44 (8.4 through 8.6), so a
pattern that uses one of these behaviours does not compile on such an engine.
A row names the PcreFeature case that owns it where there is one; the
PCRE page carries the
table of the feature-gated behaviours that differ between releases.
| behaviour | from |
|---|---|
CaselessRestrictModifier: the r modifier, (?r) and (?-r), caseless matching restricted to one script; the matches of /(k)/iur and the capture shapes under (?r) are verified from the same release |
PCRE2 10.43 |
AsciiOptions: (?a) with its D, S, W, P, T variants, (?-a) and the (?^i) restore: ASCII-only classes |
PCRE2 10.43 |
OpenAndPaddedRepeatCounts: a{,2} and a count padded with spaces, as a{ 2 }, repeat instead of matching as text |
PCRE2 10.43 |
PaddedBracedEscapes: spaces inside braced escapes, references and names, as \x{ 41 }, \g{ 1 } or \k{ name }; a braced name left open is reported past its padding |
PCRE2 10.43 |
VariableLengthLookbehind: a lookbehind may hold branches of different lengths, up to 255 characters |
PCRE2 10.43 |
^ after spaces in a property, as \p{ ^Lu} |
PCRE2 10.45 |
RangeFromTypeReadToItsEnd: a range from a type, a POSIX class or a property is read to its end before it is refused, as [\d-abc |
PCRE2 10.45 |
ErrorOffsetPastTheFault: most syntax errors are reported past the faulty character rather than on it, among them an inline option letter at the letter ((?u), a quantifier after a non-atomic lookbehind opener past the opener ((?<*+) and a called name left open past its padding |
PCRE2 10.47 |
GReferenceNumberReadBeforeClosing: an unclosed \g{-1 is refused after the number, and a count stacked on a quantified reference, as \g1+{2}, past the count |
PCRE2 10.47 |
A class under u that combines code points at or below U+00FF with code points from U+0100 up: PCRE2 reads it correctly from 10.48; before, its scan missed code points and a leading such class did not anchor the search (PCRE2 #841). The ReDoS search-cost proof follows the corrected reading |
PCRE2 10.48 |
\K inside a lookaround is a PHP rule, not a PCRE2 release: PCRE2 has
refused it at compile by default since 10.37, and PHP up to 8.4 compiles
every pattern with PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK, allowing it on any
engine, while PHP 8.5 does not set the option and refuses it there.
The place of the named keys in $matches does not depend on the version:
every PHP writes each name just before its group number. PHP 8.5 alone writes
the MARK key a second time, last, when a mark meets a group named MARK;
the key reads the mark there as on 8.4 and 8.6, so the capture shapes are the
same for every target. The bundled-engine CI row runs the suite on the 8.6
image, so this claim is exercised, not just stated.
The r flag carries a PHP floor of its own: PHP reads it from 8.4 only,
whatever the engine, while the inline (?r) and (?-r) follow the PCRE2
release alone.
Caches
RegexParser::CACHE_VERSION changes whenever the code that builds a tree
changes, in any release, and every cached tree is rebuilt then. It covers the
code that turns a tree into automata too: a DfaCacheInterface you keep across
releases is keyed on it, so its DFAs are rebuilt after such an upgrade. A cache
is never a format to depend on.