Skip to content

PHP static-property usage ranges omit the sigil #165

Description

@DavidBakerEffendi

php-parity-static-property-access still fails under Bifrost v0.10.5, but the
failure has moved from resolution to usage ranges. This is the remaining half
of the PHP sigil work and needs a Bifrost-side fix.

What changed

BrokkAi/bifrost-dev#2416 fixed the declaration side, and it works —
php-property-access now passes end to end (#160). For this case, resolution
now succeeds too:

v0.10.1 v0.10.5
selector — (symbol_resolution_failed) App.Service.EmailNotifier.sent (found)
declaration lookup wrong_target ok
usages 2 missing, 0 unexpected 2 missing, 2 unexpected

The remaining defect

Bifrost now returns the usage sites, one column short at the start:

expected returned
EmailNotifier.php:16:15-20 16:16-20
Consumer.php:10:18-23 10:19-23

The source is self::$sent++. Column 15 is the $, so 15-20 spans $sent
and 16-20 spans sent.

Why the ground truth is right here

PHP writes the sigil at a static property usage — self::$sent,
EmailNotifier::$sent — so the $ is part of the written token and belongs in
the range. Instance access is written $this->last, where the property token
is last with no sigil, and the corpus expects it without one. Bifrost gets
that case right, which is why php-property-access passes.

So the two shapes genuinely differ, and the audited expectations reflect the
language rather than an inconsistency.

Note for whoever picks this up

The bifrost-dev investigation for #2416 concluded:

Static-property usage ranges already included the sigil, and ->last
instance usages correctly don't. No usage-side change was needed

That does not hold at v0.10.5 — measured above. Either the behaviour differs
from what was checked, or the declaration-side fix did not extend to static
usage sites. Worth establishing which before changing anything, and worth not
taking the earlier note at face value.

Blocks nothing: this case is in the expected-failure set for the v0.3.1 freeze
(#155) and a failure is recorded honestly rather than gating publication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions