Dogbert
Dogbert

Reputation: 222428

Access static variables in an abstract class in PHP

Is there any other way to access a static variable from a static method, other than using classname::$variable?

Upvotes: 0

Views: 624

Answers (2)

Sarfraz
Sarfraz

Reputation: 382899

If it is different class:

classname::$variable

If it is same class:

self::$variable

Upvotes: 1

Alexander Konstantinov
Alexander Konstantinov

Reputation: 5476

self::$variable, if it's in the same class.

Upvotes: 1

Related Questions