Newsgroups: php.general,php.internals Path: news.php.net Xref: news.php.net php.general:179092 php.internals:8252 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85925 invoked by uid 1010); 28 Feb 2004 21:34:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85879 invoked by uid 1007); 28 Feb 2004 21:34:19 -0000 To: internals@lists.php.net, php-general@lists.php.net Date: Sat, 28 Feb 2004 18:34:19 -0300 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-ID: References: <20040226185122.34071.qmail@pb1.pair.com> <1077821587.403e409400404@www.3gstech.com> <20040226190236.59641.qmail@pb1.pair.com> <1077824687.403e4cafbb4d6@www.3gstech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Posted-By: 200.196.108.16 Subject: Re: [PHP-DEV] PHP5: Class behavior: method overloading From: cunha17@uol.com.br (Cristiano Duarte) 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