ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Does php support multiple inheritance if yes how, if no explaining why?

user-image
تم إضافة السؤال من قبل مستخدم محذوف‎
تاريخ النشر: 2016/06/15
Mohamed  Yasin
من قبل Mohamed Yasin , Web Administrator/ Front End Developer , Royal Crown LLC

Hi Ahmed Alrubaye.,

Here is some clarification about PHP inheritance – there is a lot of bad information on the net.  PHP does support Multi-level inheritance.  (I tested it using version 5.2.9).  It does not support multiple inheritance.This means that you cannot have one class extend 2 other classes (see the extends keyword).  However, you can have one class extend another, which extends another, and so on. Example:<?phpclass {        // more code here}class extends {        // more code here}class extends {        // more code here}$someObj = new A();  // no problems$someOtherObj = new B(); // no problems$lastObj = new C(); // still no problems?>

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟