0Pricing
PHP Academy · Lesson

Static Properties and Methods

Use static members and understand when to call them without an instance.

Introduction: Static Properties and Methods

Static members belong to the class itself rather than to any instance. Access them with ClassName::member or self:: inside the class. They are shared across all instances.

Core Concepts

Static Properties and Methods key concepts:

  • Declare with static keyword
  • Access with :: (scope resolution operator)
  • self:: inside the class; ClassName:: from outside
  • Late static binding with static::

All lessons in this course

  1. Classes, Properties, and Methods
  2. Constructors and Destructors
  3. Static Properties and Methods
  4. Magic Methods Overview
← Back to PHP Academy