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 to declare a php variables?
What does $this do in php?
How can you send email in php?
How to invoke a user function?
How to find a substring from a given string in php?
What is the use of array_count_values() in php?
What is php session start?
What is php session_start() and session_destroy() function?
Explain me differences between get and post methods?
What is php resource type?
How to execute an sql query? How to fetch its result?
How to include variables in double-quoted strings?
What is the main difference between require() and include()?
What are the two most common ways to start and finish a php block of code?
How big is nvarchar max?