Is multiple inheritance supported in PHP?
- Yes
- No
- It depends on the PHP version being used
- Multiple inheritance is not supported, but interfaces can be used to achieve similar functionality
No, multiple inheritance is not supported in PHP. PHP only supports single inheritance, which means a class can inherit from only one parent class. However, PHP does support interfaces, which can be used to achieve similar functionality as multiple inheritance by implementing multiple interfaces in a class. Interfaces define a contract that a class must adhere to, allowing for code reusability and achieving a form of multiple inheritance through interface implementation.
Loading...
Related Quiz
- In PHP, you can include a file using the include or require statement, which takes the path to the file as the ______.
- What function do you use in PHP to execute a query against a MySQL database?
- You can access the cookie's information in PHP using the $_COOKIE ______ array.
- You are writing a PHP script and you need to create a file and write to it. How would you do this?
- What is a common use case for the $_POST superglobal in PHP?