Skip to content

Fix unpack() float $offset TypeError under strict_types (#13862) - #13871

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

PurHur merged 1 commit into
masterfrom
agent/issue-13862-unpack-strict-float

Conversation

@PurHur

@PurHur PurHur commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • VM: unpack() $offset uses VmMath::parseIntBuiltinArgForFrame (TypeError on float under caller strict_types)
  • JIT: JitUnpack uses JitIntdiv::lowerIntBuiltinArgForCaller
  • Repro: test/repro/maintainer_gap_unpack_strict_float_offset.php

Closes #13862

php-src ref

ext/standard/pack.c — php_unpack, offset as zend_long with strict-types enforcement

Verification

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_unpack_strict_float_offset.php; php bin/vm.php test/repro/maintainer_gap_unpack_strict_float_offset.php'
# ok / ok

Made with Cursor

Route VM through parseIntBuiltinArgForFrame and JIT through lowerIntBuiltinArgForCaller.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 4758c27 into master Jun 30, 2026
@PurHur
PurHur deleted the agent/issue-13862-unpack-strict-float branch June 30, 2026 00:22
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: unpack() float $offset under declare(strict_types=1) — silent truncate not TypeError (ext/standard/pack.c)

1 participant