PHP parent::m() binds to the current class's own m — 'parent' is a same-file marker, so all 10 guzzle parent:: binds are wrong #532

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

Summary

In PHP, parent::m() binds to the current class's own m, which creates a fake self-recursion edge. On php-guzzle all 10 parent:: binds are wrong:

  • src/Cookie/FileCookieJar.php:47 parent::__construct(...) binds to FileCookieJar::__construct instead of CookieJar::__construct.
  • src/Exception/TransferException.php:22 binds to itself. Its parent is \RuntimeException.
  • Fixture lang-out/php/fixture/src/Child.php:26,32,48 reproduces it with resolved_by=tier1q_rel_samefile.

Cause

parent is listed as a same-file "type at hand" marker:

  • crates/indexer/src/index.rs:2100 REL_MARKERS = ["crate","super","self","Self","static","parent","this","$this"]
  • crates/abi/src/registry.rs:192 REL_QUALIFIERS = ["self","this","$this","Self","static","parent"] (the same-file-only half)

self/static/this do mean "this class". parent means the superclass, so treating it as same-file anchors it to the wrong class. Note that Rust's super is a module marker and is correctly different.

Proposal

  • Remove parent from the same-file markers.
  • Resolve parent::X through the class's SUPERTYPE-role ref, which the PHP guest already emits for extends. If there is no project supertype, leave the ref unresolved.
  • Python's super().m() (see #538) wants the same mechanism: a receiver meaning "my direct base(s)".

Acceptance

  • A fixture covering parent::__construct, parent::m with a project base, and parent::m with an external base (unresolved).
  • A guzzle bind diff with only these 10 rows changing.
  • precision_gate PHP: a decoy where the child and parent share m.
  • Mutation: put parent back into REL_QUALIFIERS, and the decoy must go red.

Found by the per-language review, 2026-11-09. Evidence: lang-out/php/audit_method_samples.json.


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 In PHP, `parent::m()` binds to the **current class's own `m`**, which creates a fake self-recursion edge. On php-guzzle **all 10 `parent::` binds are wrong**: - `src/Cookie/FileCookieJar.php:47` `parent::__construct(...)` binds to `FileCookieJar::__construct` instead of `CookieJar::__construct`. - `src/Exception/TransferException.php:22` binds **to itself**. Its parent is `\RuntimeException`. - Fixture `lang-out/php/fixture/src/Child.php:26,32,48` reproduces it with `resolved_by=tier1q_rel_samefile`. ## Cause `parent` is listed as a same-file "type at hand" marker: - `crates/indexer/src/index.rs:2100` `REL_MARKERS = ["crate","super","self","Self","static","parent","this","$this"]` - `crates/abi/src/registry.rs:192` `REL_QUALIFIERS = ["self","this","$this","Self","static","parent"]` (the same-file-only half) `self`/`static`/`this` do mean "this class". **`parent` means the superclass**, so treating it as same-file anchors it to the wrong class. Note that Rust's `super` is a *module* marker and is correctly different. ## Proposal - Remove `parent` from the same-file markers. - Resolve `parent::X` through the class's SUPERTYPE-role ref, which the PHP guest already emits for `extends`. If there is no project supertype, leave the ref unresolved. - Python's `super().m()` (see #538) wants the same mechanism: a receiver meaning "my direct base(s)". ## Acceptance - A fixture covering `parent::__construct`, `parent::m` with a project base, and `parent::m` with an external base (unresolved). - A guzzle bind diff with only these 10 rows changing. - `precision_gate` PHP: a decoy where the child and parent share `m`. - Mutation: put `parent` back into `REL_QUALIFIERS`, and the decoy must go red. Found by the per-language review, 2026-11-09. Evidence: `lang-out/php/audit_method_samples.json`. --- _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#532
No description provided.