Repository navigation
ext/strmatch: Add prepared string matching and replacement - #25122
Draft
ArtUkrainskiy wants to merge 1 commit into
Draft
ArtUkrainskiy wants to merge 1 commit into
ArtUkrainskiy wants to merge 1 commit into
Conversation
ArtUkrainskiy
force-pushed
the
str-matcher-prototype
branch
from
November 2, 2026 19:09
5025a32 to
f212775
Compare
Introduce independent final Str\Matcher and Str\Replacer classes for reusing fixed keyword dictionaries across subjects. Build hybrid Aho-Corasick automata with dense and packed sparse transitions. Use byte-based matching and reversed matching for leftmost-longest replacement, while retaining shared keyword strings. Check state, count and result limits, reject repeated initialization, and keep prepared objects uncloneable, non-serializable and incomparable. Include Unix and Windows build configuration, CI coverage and 16 PHPT tests for API semantics, binary input, overlapping matches and lifecycle.
ArtUkrainskiy
force-pushed
the
str-matcher-prototype
branch
from
November 2, 2026 19:48
f212775 to
287aaab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce independent final Str\Matcher and Str\Replacer classes for reusing fixed keyword dictionaries across subjects.
Use Aho-Corasick for byte-based matching and reversed matching for leftmost-longest replacement. Keep result keywords as shared strings, check count overflow, and reject repeated initialization.
Include Unix and Windows build configuration and 20 PHPT tests.