Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5481 invoked by uid 1010); 2 Aug 2006 17:13:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5465 invoked from network); 2 Aug 2006 17:13:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2006 17:13:07 -0000 X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from ([67.139.134.202:1048] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id E2/77-45114-12DD0D44 for ; Wed, 02 Aug 2006 13:13:06 -0400 Received: (qmail 79079 invoked by uid 98); 2 Aug 2006 17:13:04 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-1.25 ( Clear:RC:1(127.0.0.1):. Processed in 0.418657 secs); 02 Aug 2006 17:13:04 -0000 X-Qmail-Scanner-Mail-From: ceo@l-i-e.com via o2.hostbaby.com X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.418657 secs) Received: from unknown (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 2 Aug 2006 17:13:04 -0000 Received: from 67.108.68.40 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Wed, 2 Aug 2006 12:13:04 -0500 (CDT) Message-ID: <3589.67.108.68.40.1154538784.squirrel@www.l-i-e.com> In-Reply-To: <18810497049.20060801234124@marcus-boerger.de> References: <18810497049.20060801234124@marcus-boerger.de> Date: Wed, 2 Aug 2006 12:13:04 -0500 (CDT) To: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] RfC: rethink OO inheritance strictness From: ceo@l-i-e.com ("Richard Lynch") On Tue, August 1, 2006 4:41 pm, Marcus Boerger wrote: > it is about any signature that has default values or type > hints or > pass by reference info. Specialized functions, such as constructors, getters/setters, etc, would seem to me to be a Special Case, since PHP automatically calls the parent function and has to pass the args on up the inheritence tree. But I'm still not getting it in the general case of user-defined methods. Why would default values or type hints in the signature of a parent/child interfere with the arglist of a child/parent? The desire for this flexibility isn't about being "lazy" or trying to break some basic OOP theory. Perhaps I'm just so ingrained from 15 years of Lisp hacking that the idea of forced similarities between method parameters is anathema, but there have been innumerable times in the past where I had children with different arglists than their parents for the same method. I realise that PHP has no polymorphism (today, at least) and I can sort of see how one might then assume that all child methods would have the same signature in theory, but, in practice, it seems to me like an artificial restriction with no underlying reason. Consider something like this: class basic_object { function draw_self (){ } } class window extends basic_object { function draw_self (){ } } class themed_window extends window { function draw_self ($color = 'blue'){ } } Is it really that much of stretch of imagination that one might want this -- particularly with a much larger inheritence tree than this silly 3-class example? Where is the harm in this? -- Like Music? http://l-i-e.com/artists.htm