Implement mb_strstr() — multibyte strstr (ext/mbstring parity) - #19942
Merged
Merged
Conversation
Closes #19941 Adds mb_strstr($haystack, $needle, $before_needle, $encoding) to the VM via VmMbstring::strstr() using the existing utf8Strpos + utf8CharSubstr helpers. Registered in ext/mbstring/Module.php alongside mb_strrichr. Verification: php bin/vm.php repro.php — output matches Zend PHP 8.2 phpunit --filter mb_strstr — OK (2 tests, VM + JIT) phpunit --filter mb_str — OK (40 tests, no regressions) Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
added a commit
that referenced
this pull request
Jul 17, 2026
…+ FileGetContentsJitHelper PHP (#19339) (#19956) Remove the ~185 LOC libc open/read LLVM kernel from ext/standard/JitFileGetContentsKernel.php. StringFileGetContents now always routes through FileGetContentsJitHelper → VmFs::fileGetContents() via JitVmHelperLink, matching the Unlink pattern (#19186). - Delete ext/standard/JitFileGetContentsKernel.php (185 lines removed) - Remove UserScriptAotDeferNestedJit defer path from StringFileGetContents - Remove implementUserScriptKernel() method entirely - Remove kernel from spine require list; add mb_strstr.php (sync fix for #19942) - Update FileGetContentsRuntimeShrinkTest to assert kernel deletion - Regenerate bootstrap-inventory.md Verification: vendor/bin/phpunit test/unit/FileGetContentsRuntimeShrinkTest.php — OK (4 tests, 16 assertions) make bootstrap-selfhost-vm-driver-execute-probe — OK php script/bootstrap-inventory.php --check — OK 5330/5330 php script/check-selfhost-spine-coverage-sync.php — OK Closes #19339 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
mb_strstr()inext/mbstring/viaVmMbstring::strstr()using existingutf8Strpos+utf8CharSubstrhelpersext/mbstring/Module.phpalongsidemb_strrichr$before_needle, multibyte chars, and not-found caseCloses #19941
php-src reference
ext/mbstring/mbstring.c—PHP_FUNCTION(mb_strstr)Verification
Test plan
Made with Cursor