In PHP, which of the following keywords is used to access properties and methods of a parent class from a child class?

  • super
  • parent
  • this
  • self
In PHP, the 'parent' keyword is used to access properties and methods of a parent class from a child class. This is essential when you want to override a method in the child class while still using the parent class's method.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *