Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25177 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65560 invoked by uid 1010); 3 Aug 2006 09:33:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65545 invoked from network); 3 Aug 2006 09:33:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2006 09:33:19 -0000 X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.42 darkcity.gna.ch Linux 2.5 (sometimes 2.4) (4) Received: from ([195.226.6.42:52679] helo=darkcity.gna.ch) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id CD/04-44390-BD2C1D44 for ; Thu, 03 Aug 2006 05:33:17 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 5CF5DBB4E9; Thu, 3 Aug 2006 11:33:13 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXqCFJHn; Thu, 3 Aug 2006 11:33:10 +0200 (CEST) Received: from [192.168.1.43] (217-162-171-242.dclient.hispeed.ch [217.162.171.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id 5F976BB4CA; Thu, 3 Aug 2006 11:33:10 +0200 (CEST) Message-ID: <44D1C2B3.7060504@cschneid.com> Date: Thu, 03 Aug 2006 11:32:35 +0200 User-Agent: Thunderbird 1.5.0.5 (Macintosh/20060719) MIME-Version: 1.0 To: Derick Rethans CC: PHP Developers Mailing List References: <18810497049.20060801234124@marcus-boerger.de> <44CFDB2B.1010907@cschneid.com> <20060802010156.5be0258c@pierre-u64> <44CFDF89.6010506@lerdorf.com> <7.0.1.0.2.20060802153119.0c2193c0@zend.com> <44D0DB82.1070307@lerdorf.com> <7.0.1.0.2.20060803104541.0853b1e0@zend.com> <20060803095558.49c4e484@pierre-u64> <44D1B055.5070905@php.net> <44D1B505.1010300@php.net> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060608020401070203060202" X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: [PHP-DEV] RfC: rethink OO inheritance strictness From: cschneid@cschneid.com (Christian Schneider) --------------060608020401070203060202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Derick Rethans wrote: > Sure, but then that code won't run on older versions of PHP (5.1 f.e.) > anymore, so it is not a good solution. The same was true for PPP. But like you I prefer the E_STRICT version without modifying the language though. But I'm sharing Lukas' concern about the definition of E_STRICT: Is it to be changed to E_ERROR at some point? Otherwise E_NOTICE would be more appropriate IMHO. Whatever solution is implemented I propose to relax the test to not test static functions (e.g. useful for factory methods) and to allow adding default values to functions (the object of the inherited class still accepts the same parameters as the base class). A patch is attached. - Chris --------------060608020401070203060202 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="more_relaxed_paramcheck.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="more_relaxed_paramcheck.patch.txt" Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.721 diff -u -r1.721 zend_compile.c --- Zend/zend_compile.c 25 Jul 2006 00:01:40 -0000 1.721 +++ Zend/zend_compile.c 3 Aug 2006 09:26:45 -0000 @@ -2054,13 +2054,12 @@ } /* Checks for constructors only if they are declared in an interface */ - if ((fe->common.fn_flags & ZEND_ACC_CTOR) && !(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) { + if ((fe->common.fn_flags & (ZEND_ACC_CTOR | ZEND_ACC_STATIC)) && !(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) { return 1; } /* check number of arguments */ - if (proto->common.required_num_args != fe->common.required_num_args - || proto->common.num_args > fe->common.num_args) { + if (proto->common.num_args > fe->common.num_args) { return 0; } --------------060608020401070203060202--