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 is variable give example?
How do you remove whitespace from the beginning and end of a $string variable?
What is the use of header() function in php?
How do I get csrf token?
Why would we use === instead of ==?
What is the use of offset in mysql?
What is binary safe string?
Tell me what library is used for pdf in php?
What is difference between explode() or split() in PHP?
Why do we use in php?
What is a helper function?
Do you have to initialize variables in php?
Why do we use polymorphism in php?
Tell me how do I escape data before storing it into the database?
What is php ci?