Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35807 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5932 invoked by uid 1010); 26 Feb 2008 17:34:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5916 invoked from network); 26 Feb 2008 17:34:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2008 17:34:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=rewbs.soal@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rewbs.soal@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.132.250 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rewbs.soal@gmail.com X-Host-Fingerprint: 209.85.132.250 an-out-0708.google.com Received: from [209.85.132.250] ([209.85.132.250:34002] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/C1-28805-BBD44C74 for ; Tue, 26 Feb 2008 12:34:52 -0500 Received: by an-out-0708.google.com with SMTP id c18so439573anc.1 for ; Tue, 26 Feb 2008 09:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=RhAlxdmHok3e8f9PN1ERYgIrG5WqPjFxKZrQbJRoNGc=; b=o8mjc8Fv/6cuLDPzN5FomIpQNH7pkpk1UyK/1OKvGQOtnEgPCUEIq5h7LjfEjPiJnoDrdMkmv4ZnuYi66WVW2kCfkFVBqA4cA2Or20ZuHwAVFDZjbx60J3KT63o6saY9yDlIwEhFysfUo0RW7JJRpEwdyFesebmnvdvHLs86MrI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Q0aoJ/T46jtS8AyferNGFNyC3BCTcW/nJvkMtTdJY/1E2Y6l32f30pLMqyTeERln/0MvKMVrpzE6Q41iHfAgpjFr5JEd1YvWFwXnYlC5Efj9L8seiho38IuzmpR4f5WB5QbI+D/EJRt1O5pe1apXxCPqVU5fVzQ7Fp6KOaveBxg= Received: by 10.101.68.19 with SMTP id v19mr10185574ank.62.1204047289252; Tue, 26 Feb 2008 09:34:49 -0800 (PST) Received: by 10.100.47.7 with HTTP; Tue, 26 Feb 2008 09:34:49 -0800 (PST) Message-ID: <5a8807d10802260934n4da71d07v73e9b60fd1d48326@mail.gmail.com> Date: Tue, 26 Feb 2008 17:34:49 +0000 Reply-To: robin@soal.org To: "Marcus Boerger" , internals@lists.php.net Cc: "Jochem Maas" In-Reply-To: <5a8807d10801280937j11c65623l7dca63aebec7cf1a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5a8807d10801280520u7f8c7a9o8d2ab2efaa9c7644@mail.gmail.com> <1109819085.20080128151237@marcus-boerger.de> <5a8807d10801280718p6d52f689s3a13c4d8c6521a3f@mail.gmail.com> <868592137.20080128174926@marcus-boerger.de> <5a8807d10801280937j11c65623l7dca63aebec7cf1a@mail.gmail.com> Subject: Re: [PHP-DEV] Protected static props redeclared as public share value across classes From: rewbs.soal@gmail.com ("Robin Fernandes") Hi Marcus, On 28/01/2008, Marcus Boerger wrote: > > > > I checked it out in more detail and it is indeed broken as in it is not > > consistent If possible, I'd like to revive this discussion. Patch included. :) History: http://thread.gmane.org/gmane.comp.php.devel/47956/focus=47956 To summarize, we agree that there is an inconsistency related to static property inheritance, because: --> In the following case, A::$p and B::$p share the same value: class A { protected static $p; } class B extends A { public static $p; } --> Yet in the following cases, A::$p and B::$p have two separate values: class A { protected static $p; } class B extends A { protected static $p; } class A { public static $p; } class B extends A { public static $p; } You originally suggested fixing the inconsistency by changing the last 2 cases, so that A::$p and B::$p always share the same value. However, that approach raised some concerns described by myself and Jochem, for example: --> Inconsistency with overridden methods --> Inconsistency with shadowed class constants. Consequently, I'd like to propose resolving this by changing the first case, so that A::$p and B::$p always have separate values. Here's a patch that implements this. It includes relevant changes to existing tests, plus some supplementary tests to address Jochem's concern about the impact on LSB. Patch against snap php6.0-200802251530: http://pastebin.ca/919094 Disclaimer: I am not an internals expert - patch might overlook some cases, feedback welcome. :) Let me know what you think. Regards, Robin