Hi Walter,

On Thu, 26 Feb 2004 11:44:47 -0800, Walter A. Boring IV wrote:
> ----well, if you are implementing something completely new in php5,
> there there are no compatibility issues.  I have many classes in my
> projects in php4.  I'm not sure of how many child constructors have
> different parameters (my guess is not many), but enforcing strict
> parameter count for childs classes would break compatibility.  Which is
> why I think that one should just use an interface to enforce this rule. 
> It seems like the right place for it.
In the object oriented point of view, there are no differences between an
interface and a class when you use something like this: ...
} catch (MyException $e) {
...

So, MyException is a "class" or an "interface" ? You can't tell. That's
why this enforcement is applied over classes too. A class definition is
still a commitment of "interfacing". When you extend the base class you
are not supposed to break this commitment. If you allow this commitment
break, it may lead to "buggy" code when you take a class by its superclass
"interface".

Best Regards,

Cristiano Duarte

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

Reply via email to