Skip to content

Stdlib: substr_replace string/replace/offset/length named params (#23183)#23244

Merged
PurHur merged 1 commit into
masterfrom
fix/23183-substr-replace-named-params
Jul 26, 2026
Merged

Stdlib: substr_replace string/replace/offset/length named params (#23183)#23244
PurHur merged 1 commit into
masterfrom
fix/23183-substr-replace-named-params

Conversation

@PurHur

@PurHur PurHur commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • php bin/vm.php test/repro/issue_23183_substr_replace_named.phpok
  • ./script/phpunit.sh --filter 'BuiltinParamNamesAliasTest::testSubstrReplaceZendStubNamedParams|named_args_substr_replace' → OK
  • Docker AOT: ./phpc build + run named substr_replace(string:…, replace:…, offset:…, length:…)abXdef / abX
  • Docker vendor/bin/phpunit --filter 'substr_replace_named_params|addcslashes_stripcslashes_substr_replace|named_args_substr_replace|testSubstrReplaceZendStubNamedParams' → OK (9 tests)
  • ./script/ci-fast.sh — red on master-unrelated check-no-unlimited-memory (maintainer_gap_max_memory_limit_ini_85_ceiling.php from Stdlib: PHP 8.5 max_memory_limit INI ceiling (#23232) #23238); AOT build smoke OK

Verification transcript (Docker)

$ php bin/vm.php test/repro/issue_23183_substr_replace_named.php
ok
$ ./phpc build -o /tmp/sr_named /tmp/sr_named.php && /tmp/sr_named
abXdef
abX
$ vendor/bin/phpunit --filter 'substr_replace_named_params|addcslashes_stripcslashes_substr_replace|named_args_substr_replace|testSubstrReplaceZendStubNamedParams'
OK (9 tests, 24 assertions)

php-src-strict; PHP-in-PHP only (no new C). Reference: ext/standard/string.c / string.stub.php.

Made with Cursor

)

Override InternalArgInfo str/repl/start with Zend stub names, and fix
JitSubstrReplace PHI predecessors after jitCopySlice/concat so AOT verifies.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: substr_replace Reflection names str/repl/start — Zend string/replace/offset; named args rejected (ext/standard/string.c)

1 participant