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 the rules in creating php variable?
How to get the number of characters in a string?
Is php used for frontend or backend?
How would you open a directory for reading in php?
What good is polymorphism?
What is a model in php?
How to randomly retrieve a value from an array?
What does php do?
Explain what does $_server means?
What are the special characters you need to escape in single-quoted stings?
What is a php session?
Can php replace javascript?
Explain what are the different errors in php?
What's the difference between accessing a class method via -> and via ::?
What is the use of "ksort" in php?