PHP new \Foo (explicit global) binds a same-named project class: the 0.1.4 anchor fix covered the type ref but not its paired call ref #533

Closed
opened 2026-11-09 08:35:47 +01:00 by buildagent · 1 comment
Member

Summary

PHP new \InvalidArgumentException(...) (an explicit global-namespace class) binds to a project class with the same short name, GuzzleHttp\Exception\InvalidArgumentException, via tier1b_qualified_bypass. There are 13 resolved phantoms on php-guzzle, for example src/Pool.php:156. Fixture: lang-out/php/fixture/src/Child.php:43.

Cause: half of a paired fix

crates/guest/php/src/php.rs:1387 emit_object_creation (and :904 emit_function_call) drop the leading \: the ref is qualified, but its qualifier is None. Package 0.1.4 fixed this for the type ref (parity-deltas.toml, type-ref-written-namespace) but not for its paired call ref. ("Fixing one half of a paired field makes the other the bug.")

Proposal

  • Carry a global-anchor qualifier (\) on every PHP ref written with a leading backslash: call, new, type, static.
  • Tier 1b must refuse to bind an anchored ref to a symbol outside the root namespace.
  • A registry test asserts that every PHP emit site that reads a qualified_name node carries its anchor. That turns the pair into a structural rule, so the next half cannot be missed.

Acceptance

  • The 13 guzzle phantoms become unresolved.
  • precision_gate PHP gains a \X vs Ns\X decoy for new.
  • Mutation: drop the anchor on the call ref, and the decoy must go red.

Filed from the per-language review on 2026-11-09: 8 agents, one per language plus one for Vue/Svelte/XAML/timeline, run against copies of the pinned corpus repos (tests/corpus/corpus.toml) using installed build 2dcfc615, which differs from master only by XAML/CI commits. The top claim of every issue was spot-checked in the main session. Artifacts live under the review session's scratchpad lang-out/<lang>/ and are available on request.

## Summary PHP `new \InvalidArgumentException(...)` (an **explicit global-namespace** class) binds to a project class with the same short name, `GuzzleHttp\Exception\InvalidArgumentException`, via `tier1b_qualified_bypass`. There are 13 resolved phantoms on php-guzzle, for example `src/Pool.php:156`. Fixture: `lang-out/php/fixture/src/Child.php:43`. ## Cause: half of a paired fix `crates/guest/php/src/php.rs:1387` `emit_object_creation` (and `:904` `emit_function_call`) drop the leading `\`: the ref is qualified, but its qualifier is None. Package 0.1.4 fixed this for the **type** ref (`parity-deltas.toml`, `type-ref-written-namespace`) but not for its paired **call** ref. ("Fixing one half of a paired field makes the other the bug.") ## Proposal - Carry a global-anchor qualifier (`\`) on every PHP ref written with a leading backslash: call, `new`, type, static. - Tier 1b must refuse to bind an anchored ref to a symbol outside the root namespace. - A registry test asserts that every PHP emit site that reads a `qualified_name` node carries its anchor. That turns the pair into a structural rule, so the next half cannot be missed. ## Acceptance - The 13 guzzle phantoms become unresolved. - `precision_gate` PHP gains a `\X` vs `Ns\X` decoy for `new`. - Mutation: drop the anchor on the call ref, and the decoy must go red. --- _Filed from the per-language review on 2026-11-09: 8 agents, one per language plus one for Vue/Svelte/XAML/timeline, run against copies of the pinned corpus repos (`tests/corpus/corpus.toml`) using installed build `2dcfc615`, which differs from master only by XAML/CI commits. The top claim of every issue was spot-checked in the main session. Artifacts live under the review session's scratchpad `lang-out/<lang>/` and are available on request._
Author
Member

Consolidated into #531 during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.

Consolidated into **#531** during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#533
No description provided.