[nycphp-talk] OOP Newbie Building arrays in extended classes

Anthony Ferrara ircmaxell at
Tue Jan 29 09:43:46 EST 2013

The constructor's return value is always ignored internally. So the only
time the constructor's return is ever used is in a child-class.

if (parent::__construct()) {
    // blah

But I'd argue that if you need to do that, inheritance isn't what you need,
but another form of composition...


On Tue, Jan 29, 2013 at 9:34 AM, David Mintz <david at> wrote:

> This might be little more than a matter of style, but I would add that I
> don't think Person's  __construct() should return a boolean. By definition
> it returns an instance of the Person class, so you need not explicitly
> return anything.
> --
> David Mintz
> Fight for social equality:
> _______________________________________________
> New York PHP User Group Community Talk Mailing List
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list