What type of inheritance that PHP supports?
Answer Posted / mahesh
PHP can support single,multilevel,hierarchical and hybrid
inheritance but not multiple inheritence because of diamond problem.
Q:what is diamond problem?
A:suppose "class A extends class B and also class C".
then if class B contains function foo() and class C also contains function foo().if your creates object to the class A
and try to call function foo() then which class function it will take class A or Class B.. in this case diamond problem will be occur.
But we can avoid this problem through "INTERFACE".
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
What are php strings?
What are the common uses of php?
Who is the father or inventor of php?
what the new feature add in php 7.2?
How to count all the lines of code in a directory and sub folder?
What are sql injections, how do you prevent them and what are the best practices?
Write a program to swap two numbers using php.
What is the main difference between asp net and php?
What are psrs? Choose 1 and briefly describe it?
How to get ip address of a server in php?
In php how can you jump in to and out of "php mode"?
Can I run php without xampp?
What is self in php?
What is the use of mysql_fetch_array in php?
How to get the http request in php?