Stdlib: TypeError for str_replace string $search + array $replace (#22827)#22844
Merged
Conversation
…2827) Match php-src string.c: array $replace is illegal when $search is a string. VM throws; JIT/AOT emit via JitStrReplaceSearchReplaceGuard (valueBoxHashtable). Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 24, 2026
PurHur
added a commit
that referenced
this pull request
Jul 24, 2026
…22847) #22843 StringPack NestedJIT + #22844 str_replace TypeError moved live lowering_source_fingerprint to 159f4081… while the committed stamp stayed at 6998141b…, redding north-star5-verify-fast step 4f-m and user_release_ready. Restamp only; honest verified-fresh rebuild remains on #22642/#22717. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
$search/$replacesupport, restore php-src's inverse guard: string$search+ array$replacemustTypeError(not silently use$replace[0]).ext/standard/string.cphp_str_replace_common/ stub signatures.str_replace.php/str_ireplace.php; JIT/AOT via newJitStrReplaceSearchReplaceGuard(detectsvalueBoxHashtablearray literals + runtime boxed arrays). No new C inruntime/.Verification
Pillar 1 snapshot (pre-claim)
OK 6511→6512with this file)north-star5-fast: red at 4f-m gen-0 mismatch (Self-host M5: bootstrap-inventory argv driver size floor — grow beyond 451KB stub #8713 / Gen-1+ #1492: committed gen-0 seed cannot be rebuilt — refresh OOMs at 48 GiB, 44 restamps since the blob last changed (script/bootstrap-refresh-gen0-sidecar.sh) #22642) — pre-existing, not this PRuser_release_ready: no (same)Test plan
$search+ array$replacestill'AB'.phptMade with Cursor