Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25084 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56872 invoked by uid 1010); 1 Aug 2006 20:55:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56857 invoked from network); 1 Aug 2006 20:55:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Aug 2006 20:55:37 -0000 X-Host-Fingerprint: 87.123.82.236 i577B52EC.versanet.de Received: from ([87.123.82.236:12081] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 84/9B-45114-A9ABFC44 for ; Tue, 01 Aug 2006 16:33:30 -0400 Message-ID: <84.9B.45114.A9ABFC44@pb1.pair.com> To: internals@lists.php.net Date: Tue, 01 Aug 2006 22:33:24 +0200 User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 References: <44C09BE7.2010105@metropolis-ag.de> <26990.67.108.68.40.1154458144.squirrel@www.l-i-e.com> In-Reply-To: <26990.67.108.68.40.1154458144.squirrel@www.l-i-e.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 87.123.82.236 Subject: Re: [PHP-DEV] RfC: rethink OO inheritance strictness From: lsmith@php.net (Lukas Smith) Richard Lynch wrote: > So what exactly is the purpose of enforcing the same args here? > > Does it make the C code under the hood simpler? > > Does it make PHP an order of magnitude faster? > > I'm honestly just sitting here asking myself WHY anybody wants this, > and not finding any benefit at all. I think this was stated before in this thread. The academic idea of OOP is that children are essentially expanded variants of their parents, but for all intends and purposes their interface is just like the parent with some additions. So in other words a child is an instance of all of its parent. If you remove arguments from the signature of methods this no longer applies and you have violated this OOP rule. It should be possible to implement your inheritance in such a way that this will not bite you, but I do not think its PHP job to police this by default. I want to bring up again the idea of an optional strict mode (alternatively we can talk about a lax mode, but I think it makes more sense to maintain BC and stay lax by default) that does it all according to academic OOP (check signature of children, disallow on the fly static properties etc.). regards, Lukas