php / php/doc-en

Is calling static methods non-statically still supported, and with which syntax(es)?

Open
#2,125 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

From manual page: https://php.net/language.oop5.static


Prior to #329, the documentation about static methods and properties stated that

A property declared as static cannot be accessed with an instantiated class object (though a static method can).

The parenthesized part disappeared with this PR, and now it’s not documented whether things like

class A {
	public static function foo() {
		echo "foo\n";
	}
}
$a = new A();
$a->foo();

are officially supported and future-proof, or just happen to work in current PHP versions. Please be explicit about it.

Contributor guide

No contributing guide indexed for this repository

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 with the static methods and properties manual page linked in the issue, then review the documentation change in #329. Check the shown PHP example against the documented behavior and determine which syntax is officially supported and future-proof. Update the manual page to state that status explicitly.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.