PHP - Inheritance and Polymorphism
What does type hinting with a parent class in PHP allow?
For example, using function foo(ParentClass $obj).
What does type hinting with a parent class in PHP allow?
For example, using function foo(ParentClass $obj).
ParentClass $obj allows passing instances of ParentClass or any class that extends it.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions