Skip to content

Language: fix enum <=> var_dump ARG_SEND misbind (#10203) - #15937

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-10203-enum-spaceship-var-dump
Jul 4, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-10203-enum-spaceship-var-dump

Conversation

@PurHur

@PurHur PurHur commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Regression of #10203 / re-#9796: var_dump(E::A <=> E::B) printed enum(E::B) instead of int(1) because TYPE_ARG_SEND wired a hoisted enum-case temp instead of the spaceship result slot.

  • Include immediate comparison CFG preludes in precedingInlineCallArgProducersBeforeCfgOp when they directly precede the consumer call
  • Final compileCallArgSends pass prefers the immediate spaceship/relational prelude for dead inline temporaries
  • Do not discard matched comparison producers when the call arg is a dead temp

php-src reference: Zend/zend_enum.c — zend_compare_enum / spaceship on backed enum cases.

Verification

php bin/vm.php test/repro/maintainer_spaceship_enum.php
# int(1)
# int(1)
# int(1)

vendor/bin/phpunit --filter 'EnumSpaceshipMaintainerReproTest|testVarDumpEnumSpaceshipSendsSpaceshipResultSlot|testVarDumpSpaceshipFromSendsSpaceshipResultSlot'
# OK (4 tests, 10 assertions)

Closes #10203

Made with Cursor

var_dump(E::A <=> E::B) wired the hoisted enum-case temp instead of the
spaceship result. Prefer the immediate comparison CFG prelude in
compileCallArgSends and include it in precedingInlineCallArgProducers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@PurHur
PurHur merged commit 384b96b into master Jul 4, 2026
@PurHur
PurHur deleted the agent/issue-10203-enum-spaceship-var-dump branch July 4, 2026 07:28
PurHur added a commit that referenced this pull request Jul 4, 2026
…G ops (#15816) (#15941)

#15937 added immediate-prelude comparison wiring that passed Echo_ terminals
into a ?Expr-only helper, causing compile-time TypeError on var_dump() and
other multi-arg calls. Accept mixed and return false for non-Expr nodes so
the existing #15823 ternary phi slot wiring can run again.

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: spaceship (<=>) on backed enum cases — VM still inverts Zend signs (re-#9796, Zend/zend_enum.c)

1 participant