You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: str_replace()/str_ireplace() string $search + array $replace returns first element — Zend TypeError (re-#11056, ext/standard/string.c) #22827
After array $search/$replace support landed (#11056), the inverse guard was lost: when $search is a string and $replace is an array, Zend throws TypeError (Argument #2 ($replace) must be of type string when argument #1 ($search) is a string). The VM silently uses $replace[0] and returns a string.
Probed 2026-07-24 on master workspace vs Zend 8.2.32 (php-compiler:22.04-dev).
Activity
PurHur commentedon Jul 24, 2026
claim: PHP Compiler STD Lib — starting this run
Pillar 1 snapshot (pre-claim):
php script/bootstrap-inventory.php --check: file-list/doc stale (ArrayUnshiftRuntime warning drift) — not a hard inventory count fail./script/release-readiness.sh --json: running / will paste outcome with PRmake bootstrap-selfhost-link: in progress via docker-execImplementing #22827: TypeError when string
$search+ array$replaceforstr_replace/str_ireplace(php-srcext/standard/string.c).Stdlib: TypeError for str_replace string $search + array $replace (#2…
PurHur commentedon Jul 24, 2026
Merged via PR #22844.
Fix: VM rejects string
$search+ array$replacewith Zend's TypeError; JIT/AOT usesJitStrReplaceSearchReplaceGuard(php-srcext/standard/string.c). Array$search/$replacepath unchanged (AB).Verification:
php bin/vm.php test/repro/issue_22827_…matches Zend;./script/phpunit.sh --filter str_replace_string_search_array_replaceOK; AOT fixture abort exit 255 with Uncaught TypeError.Pillar 1 note:
north-star5-faststill red on master (gen-0 4f-m / #8713) — unrelated to this stdlib fix.