This is the composition vs. inheritance debate, right?

In inheritance, B is a descendant of A. With composition, A has a B.

Richard



On Jun 22, 2009, at 9:07 PM, Kirk Cerny wrote:


This just seems like a really bad idea to me.
You also mentioned that there is a parent class, but I dont see the
extends keyword.

<?php

Class A {

  var $msg = 'Why hello there my old friend';

  function  __construct() {
  }

}


Class B extends A {

  function __construct() {
  }

}



$b = new B();

echo $b->msg;

Kirk Cerny



_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to