Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36612 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63189 invoked from network); 27 Mar 2008 10:59:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2008 10:59:58 -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 66.249.82.225 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: 66.249.82.225 wx-out-0506.google.com Received: from [66.249.82.225] ([66.249.82.225:24794] helo=wx-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/16-32389-A2E7BE74 for ; Thu, 27 Mar 2008 05:59:55 -0500 Received: by wx-out-0506.google.com with SMTP id s14so4800835wxc.26 for ; Thu, 27 Mar 2008 03:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; 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=Q1SjQ0sRjBjibGAUdyggPJ86SycUKcW+fEEa8qqDNig=; b=iVX61JEKvwh5KgUTjPQ2yRLfJqDGkREwtCiohChnJnn0zpKY9HaOusbHNwFRMmvtS/sJhDhPQeiLFdHsmV+ShMVjc9Wbk8Xl9lNtd6W1Jy2RntxJSXckNWpxd9JQhlyMwUtldQkQhbI4tpW3VlgcoWK2yJfGhXwu9LHxvXYbSXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LITurZMJtREVDAYNXeoNg3fJ85N68ZBIkpPFvt936Q+WOVzH+V3F3pkTVhdBAKVcrqPQWkWzVAFcCxvEHa/Khvn1nanEifawiJhwDlscfxwQMgVYdqJGfsuTkrdqQeOU3Bn/4HBD+Yz2LhR65PlgIY9BMIFR4maKTcDkBUD4SmE= Received: by 10.100.41.4 with SMTP id o4mr3059668ano.1.1206615591611; Thu, 27 Mar 2008 03:59:51 -0700 (PDT) Received: by 10.100.11.13 with HTTP; Thu, 27 Mar 2008 03:59:51 -0700 (PDT) Message-ID: <5a8807d10803270359x5e7cb315m64e5f22e248129cd@mail.gmail.com> Date: Thu, 27 Mar 2008 10:59:51 +0000 Reply-To: robin@soal.org To: "Marcus Boerger" , internals Cc: "Alexey Zakhlestin" , RQuadling@googlemail.com, "Felipe Pena" , "Lars Strojny" In-Reply-To: <56335354.20080326181859@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5a8807d10802050343r43742844we89366ec47b57f4b@mail.gmail.com> <46ccd1ab0803241816k413c7605p2c3fb9139afd8536@mail.gmail.com> <5a8807d10803250404o6fd33662wbbf3ff14d296cb2a@mail.gmail.com> <1206444907.11368.4.camel@localhost> <1206445347.5400.1.camel@felipe> <10845a340803260945u7a49d991uac5d39be13cca988@mail.gmail.com> <10845a340803260956g6166feaboc04e55c88a9a1a8c@mail.gmail.com> <56335354.20080326181859@marcus-boerger.de> Subject: Re: [PHP-DEV] Inconsistencies when accessing protected members From: rewbs.soal@gmail.com ("Robin Fernandes") Hi all, thanks for thinking about this. On 26/03/2008, Marcus Boerger wrote: > On 26/03/2008, Alexey Zakhlestin wrote: > > > use case for "protected" is similiar, but relates to cases when you > > have hierarchy of classes, which still have some common functionality, > > which might be usable for multi-instance operations > > Thanks. This is the exact way we see this. Anything that violates this rule > is a bug. Ok, good. So to get back to the original question (http://turl.ca/kfanjo), in the following case, should B1::f() be visible from B2 in the code example below? Note that: - B1 and B2 both extend A. B2 is neither an ancestor nor a descendant of B1, but I suppose they could be considered to be part of the same class hierarchy because they are siblings. - f() is declared as protected in A and B1, but not declared at all in B2. - The docs state: "Protected limits access to inherited and parent classes (and to the class that defines the item)" - http://php.net/manual/en/language.oop5.visibility.php . Currently, B1::f() is visible from B2. --> If this is a bug, Felipe's patch (http://ecl.mediain.com.br/diff/protected.diff) fixes the issue. Let's commit it! :) --> If this is not a bug then the docs need to be clarified. Furthermore, callbacks, is_callable(), lookups to the clone & destruct magic methods and possibly property access should all be changed, because they currently do not adhere to this rule (as illustrated in the code snippets in http://turl.ca/kfanjo ). The code: Regards, Robin.