Which keyword is used in PHP to inherit a class?
- extends
- inherit
- interface
- extends/implement
In PHP, the 'extends' keyword is used to inherit a class, allowing a new class (the child class) to inherit the properties and methods of an existing class (the parent class). This is a fundamental concept in object-oriented programming (OOP).
Loading...
Related Quiz
- Which of the following is a common best practice when writing PHP functions?
- What does $_COOKIE mean?
- You have a PHP script and you need to get the list of all supported filters. How would you do this?
- What does accessing a class via :: mean?
- Which PHP function can be used to check if a function has been defined?