Skip to content

Language: match expression (PHP 8) — closes #143 - #1243

Merged
PurHur merged 1 commit into
masterfrom
issue-143-match-expression
May 23, 2026
Merged

PurHur merged 1 commit into
masterfrom
issue-143-match-expression

Conversation

@PurHur

@PurHur PurHur commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add parseExpr_Match in php-cfg (vendor patch) lowering match to === / JumpIf / Assign chains, seeding the result temporary in the entry block so all arms share one compile slot.
  • Remove Expr_Match from UnsupportedRegistry; add compliance PHPTs (match_int, match_identical) and update capability-syntax docs (VM/JIT/AOT compile probes green).

Test plan

  • php bin/vm.php -r 'echo match (2) { 1 => "a", 2 => "b", default => "c" };'b
  • vendor/bin/phpunit test/unit/UnsupportedRegistryTest.php
  • ./script/docker-ci-local.sh fast --filter UnsupportedRegistryTest
  • ./script/docker-ci-local.sh (full LLVM gate) on maintainer host
  • JIT runtime for match snippets (compile probe passes; bin/jit.php -r hit a segfault in harness — follow-up if reproduced on full CI)

Closes #143

Made with Cursor

Lower match in php-cfg to strict === comparisons and jump-if chains,
with shared result scope across arms. Adds compliance PHPTs and marks
the construct supported in lint and capability docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f9387bb into master May 23, 2026
1 check failed
@PurHur
PurHur deleted the issue-143-match-expression branch July 16, 2026 00:12
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.

Language: match expression (PHP 8)

1 participant