What is the difference between self:: and static:: when calling a method or property in an inherited class?

Last updated 30 June 2026

  • self:: resolves at compile time to the class where the code is written, ignoring child overrides.

  • static:: uses late static binding (PHP 5.3+) to resolve to the class actually called at runtime, so child overrides are honored.

  • Factory methods use new static() so subclasses return instances of their own type.

  • https://www.scribd.com/document/987319292/PHP-Laravel-Interview-150-Questions-by-Haxneeraj
  • https://www.techiejobs.co/blog/post/techiejobs/15-tricky-interview-questions-for-php-developers
All PHP interview questions