Skip to content

Compiler: Register JIT-stubbed switch in UnsupportedRegistry (lint parity) #288

@PurHur

Description

@PurHur

Problem

switch works in the VM but JIT leaves TYPE_CASE stubbed (#96). phpc lint may still report exit 0 for router scripts using switch, so #246 MiniWebApp lint-first workflow misleads contributors until JIT compile fails later.

docs/unsupported-syntax.md lists loops/?? but not switch or JIT-only gaps.

Goal

When lint runs in JIT-aware mode (or by default for project lint #283), flag Stmt_Switch / switch CFG nodes with tracking issue #96 unless JIT implementation lands.

Minimal path: always report switch as unsupported for AOT/JIT deploy until #96 closes (VM-only apps can document exception).

Scope

  • Add Stmt_Switch (and case bodies if needed) to lib/Lint/UnsupportedRegistry.php
  • Update docs/unsupported-syntax.md table
  • test/unit/UnsupportedRegistryTest.php or lint PHPT: switch exits 1 with see #96
  • Optional --target=vm|jit|aot flag on phpc lint (stretch; default VM-only OK for phase 1)

Acceptance criteria

./phpc lint -r 'switch (1) { case 1: echo 1; }'

Exit code 1; stderr/JSON references #96.

Verification

./script/ci-local.sh --filter Lint

Local/Docker only — no GitHub Actions.

Dependencies

Links

  • lib/Lint/UnsupportedRegistry.php, lib/JIT.php, lib/Compiler.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions