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


Please Help Members By Posting Answers For Below Questions

What does nan stand for computer science?

500


What are PHP Magic Methods/Functions. List them.

543


What is difference between put and post method in http?

473


What is the best way to avoid email sent through php getting into the spam folder?

548


How to redirect https to http url through .htaccess?

495






What is echo in html?

495


Explain me how failures in execution are handled with include() and require() functions?

608


Is array empty php?

500


What is php call function?

496


How can we set and destroy the cookie in php?

488


Is php better than java?

539


What is regular expression in php?

535


Tell me how to execute an sql query? How to fetch its result?

491


How is it possible to propagate a session id?

509


Explain the difference between mysql_connect and mysql_pconnect?

475