Skip to content

Stdlib: mbstring float int params TypeError under strict_types (#13849) - #13879

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-13849-mb-float-strict
Jun 30, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-13849-mb-float-strict

Conversation

@PurHur

@PurHur PurHur commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • mb_substr(), mb_strimwidth(), mb_strcut(), and mb_strpos() int operands now use frame-aware guards (parseIntBuiltinArgForFrame) via shared VmMbstring helpers.
  • Under declare(strict_types=1), float offsets/lengths raise TypeError; coercive call sites still truncate like Zend.
  • php-src reference: ext/mbstring/mbstring.c.

Closes #13849

Test plan

./script/docker-exec.sh -- php test/repro/maintainer_gap_mb_substr_float_offset.php
# exit 0

./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_gap_mb_substr_float_offset.php
# exit 0

./script/docker-exec.sh -- bash -lc 'cd /compiler && vendor/bin/phpunit test/compliance/MbFloatIntStrictVMTest.php'
# OK (1 test)

./script/docker-exec.sh -- bash -lc 'cd /compiler && php bin/compile.php -l test/repro/maintainer_gap_mb_substr_float_offset.php'
# AOT lint OK

Made with Cursor

Route mb_substr/mb_strimwidth/mb_strcut/mb_strpos int operands through
parseIntBuiltinArgForFrame so caller strict_types rejects floats while
coercive call sites still truncate like Zend.

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.

Stdlib: mb_substr()/mb_strimwidth()/mb_strcut()/mb_strpos() float int params under strict_types — TypeError missing (ext/mbstring/mbstring.c)

1 participant