Skip to content

Stdlib: mb_ereg_replace/mb_decode_mimeheader(null) TypeError under strict_types (#30311) - #30357

Merged
PurHur merged 1 commit into
masterfrom
agent/ext-io-30311-mb-ereg-replace-null-strict
Aug 11, 2026
Merged

Stdlib: mb_ereg_replace/mb_decode_mimeheader(null) TypeError under strict_types (#30311)#30357
PurHur merged 1 commit into
masterfrom
agent/ext-io-30311-mb-ereg-replace-null-strict

Conversation

@PurHur

@PurHur PurHur commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Under declare(strict_types=1), mb_ereg_replace(null, …) and mb_decode_mimeheader(null) now raise Zend-matching TypeError instead of soft-coercing.
  • Switched VM args to VmString::trimFamilyStringArgForFrame (strict TypeError; non-strict Deprecated+coerce retained).
  • JIT/AOT compile-time null rejects via JitInternalStrictArg::rejectNullString.
  • php-src: ext/mbstring/mbstring.stub.php, php_mbregex.c, mbstring.c.

Closes #30311

Test plan

  • Zend / VM / JIT issue repro (test/repro/issue_30311_mb_ereg_replace_decode_mimeheader_null_strict.php) — TypeError messages match
  • Non-strict soft path — Deprecated + coerce matches Zend ('bcb' / '')
  • vendor/bin/phpunit test/compliance/MbEregReplaceDecodeMimeheaderNullStrictVMTest.php — OK
  • vendor/bin/phpunit test/compliance/MbEregReplaceDecodeMimeheaderNullStrictJITTest.php — OK
  • vendor/bin/phpunit --filter 'mb_ereg_replace_decode_mimeheader_null_strict|mb_decode_mimeheader_null_strict' test/aot/AotTest.php — OK (2 tests)
  • AOT uncaught smoke: exit 255 with TypeError message for both builtins

Pre-work gates (master)

  • docker info: OK
  • release-readiness: user_release_ready: no (stale DOM helper-runtime prelink — unrelated)
  • north-star5-verify-fast: ok
  • bootstrap-selfhost-link: partial — stale gen-0 seed, Zend fallback compile in progress (not required for this parity fix)

Made with Cursor

…rict_types (#30311)

Use trimFamilyStringArgForFrame (caller strict_types) so null string args match Zend TypeError instead of soft-coercing; keep non-strict Deprecated+coerce. JIT/AOT compile-time null rejects added.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 3915518 into master Aug 11, 2026
1 check failed
@PurHur
PurHur deleted the agent/ext-io-30311-mb-ereg-replace-null-strict branch August 11, 2026 19:37
PurHur added a commit that referenced this pull request Aug 11, 2026
…lace (#30363) (#30370)

Regenerate docs/bootstrap-inventory.md so --check matches tip after #30351/#30357
(method-count drift). No gen-0 fingerprint restamp.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
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: mb_ereg_replace(null)/mb_decode_mimeheader(null) under strict_types coerce — Zend TypeError (ext/mbstring)

1 participant