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 html entities?
What are the characteristics of php variables?
What is smarty?
What is input sanitization in php?
How to remove blank spaces from the string?
What is the purpose of php?
Are php sessions secure?
How to include variables in double-quoted strings in php?
What is isset function in php?
What is the output of the ucwords function in this example?
What is meant by an associative array?
Tell me how to create a text file in php?
Steps for the payment gateway processing?
How to pass an argument to a function?
What is the use of limit in mysql?