Hi all.

Another issue. :) As usual, I searched the archive first, but found only a
few postings from 2004 on the subject, without much clarification, so I'd
like to pose the question again. If this has been discussed, I'd welcome
hearing what was the outcome of it.

In PHP, unlike other languages with support for OO (such as C++ and Java),
base class constructors are not automatically called (or enforced being
called). I wonder why this is so? If the answer is "flexibility", has the
issues arising from this been seriously considered...?

This means that if I make a base class "Base", which needs to have its
constructor and/or destructor called, to be initialised properly, there's
currently _no way_ to enforce that, in PHP (that I know of). This means you
risk half-constructed and half-destructed objects around, and in that case,
program correctness is compromised.

Regards,

Terje

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to