Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64486 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31028 invoked from network); 2 Jan 2013 21:08:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2013 21:08:36 -0000 Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 67.200.53.250 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 67.200.53.250 mail.zerocue.com Received: from [67.200.53.250] ([67.200.53.250:49703] helo=mail.zerocue.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/10-12868-4D1A4E05 for ; Wed, 02 Jan 2013 16:08:36 -0500 Received: from [172.16.10.217] (unknown [97.79.213.78]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.zerocue.com (Postfix) with ESMTPSA id C9EBA1203A3 for ; Wed, 2 Jan 2013 21:08:32 +0000 (UTC) Message-ID: <50E4A1D9.1050901@zerocue.com> Date: Wed, 02 Jan 2013 15:08:41 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: PHP Developers Mailing List References: <50E41BB6.4030901@zerocue.com> <50E4697D.9000008@mrclay.org> In-Reply-To: <50E4697D.9000008@mrclay.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 for Final Review before Vote From: cpriest@zerocue.com (Clint Priest) On 1/2/2013 11:08 AM, Steve Clay wrote: > A few remaining questions. The RFC makes it clear that > ReflectionClass::getMethods() does not return internal method names > like __setSeconds. > 1. Are these names visible via get_class_methods() / method_exists() / > is_callable()? This is the only remaining point of contention but I would expect however it is resolved, all methods of reflection would match. > 2. Inside an accessor, what do __FUNCTION__ and __METHOD__ evaluate as? I would have to test them but they are methods so they should evaluate as you would expect, I'll test. > 3. What happens if a class/subclass contains a regular method > __setSeconds? Same thing as a duplicate function declaration error, since that's what it is, remember that the prefix __ is reserved for php internal use, if I recall correctly userland code should not be using a double underscore. > Steve Clay On 1/2/2013 11:41 AM, Steve Clay wrote: > The RFC does not specify whether it's a fatal error to define a class > (directly or via extends/traits) which has both a traditional property > and accessor with the same name, but I think this should be prohibited > to avoid confusion. > > One might expect this to work if the traditional property is private > in a parent class, but I think even if the patch allowed that special > case (I've not tried it), it should not. As of the current fork there is no difference between a property and a property with accessors except that a property with accessors will always route through the accessor methods. In other words a property_info structure is created for either type. Ergo, the same rules apply, a second declaration of a property with the same name will cause a compilation error. -- -Clint