Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain the concept of late static binding and how it differs from static binding.
Answer: Late static binding allows accessing the called class using the 'static' keyword, while static binding refers to the class in which the method is defined. Late static binding is resolved at runtime.

Example:

class ParentClass { 
public static function whoAmI() { 
echo static::class; } } 

class ChildClass extends ParentClass { } 
ChildClass::whoAmI(); // Outputs 'ChildClass'
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook