php / php/php-src

Static property hooks

Open
#23,196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Category: Engine Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Has anyone ever asked for property hooks on static properties? Or, more importantly: has anyone actually gone through the trouble of writing an RFC for it?

The current Property Hooks RFC explicitly excludes static properties. I was wondering whether this is simply a limitation that has never been addressed, or whether there are good reasons why static property hooks should not exist.

For example:

class Foo
{
    public static string $bar {
        get => ...;
        set => ...;
    }
}

If there is interest, I would be happy to take on the work of writing the RFC.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Property Hooks RFC referenced in the issue and determine what would need to change for static properties. Done means producing and documenting an RFC that explains the proposal and addresses whether static property hooks should be supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.