Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64494 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11424 invoked from network); 3 Jan 2013 10:40:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2013 10:40:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; 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:53082] helo=mail.zerocue.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/25-35624-01065E05 for ; Thu, 03 Jan 2013 05:40:16 -0500 Received: from [172.17.0.122] (unknown [66.25.151.173]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.zerocue.com (Postfix) with ESMTPSA id 07AB4120340; Thu, 3 Jan 2013 10:40:12 +0000 (UTC) Message-ID: <50E56006.3050400@zerocue.com> Date: Thu, 03 Jan 2013 04:40:06 -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: Steve Clay CC: PHP Internals References: <50E41BB6.4030901@zerocue.com> <50E4A43E.6030302@zerocue.com> <50E4B232.5000505@mrclay.org> <50E4BDDE.8050509@zerocue.com> <50E4D0BB.7060701@mrclay.org> <50E4FA09.7030001@zerocue.com> <3D3FCC7A-0732-40AA-A5D2-07F0D3A42315@mrclay.org> In-Reply-To: <3D3FCC7A-0732-40AA-A5D2-07F0D3A42315@mrclay.org> Content-Type: multipart/alternative; boundary="------------010905000103060305050403" Subject: Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 for Final Review before Vote From: cpriest@zerocue.com (Clint Priest) --------------010905000103060305050403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit That has not been covered and it is a problem, just tested it. Anyone have any preferences on a resolution? Only thing that really needs to occur is that the function names need to be unique, we could prefix any capitals in a variable name with an additional _ such that: class A { public $Foo { get; set; } public $foo { get; set; } } Would mean there would be these function names: A::__get_Foo(); A::__set_Foo(); A::__getfoo(); A::__setfoo(); Along w/ their unset/isset'rs. This is what happens as of right now: Fatal error: Cannot redeclare a::__getfoo() in /opt/php-core/git/trunk-accessor/cpriest/php/quick2.php on line 9 Good catch on that one. On 1/2/2013 11:52 PM, Steve Clay wrote: > On Jan 2, 2013, at 10:24 PM, Clint Priest wrote: >> I've updated the Shadowing section of the RFC which I hope clears this up, it also includes a slightly modified version of your example at the bottom with comments. > Updated RFC really helps. The notion of $this->prop access semantics depending on which accessor you're in seems important for the RFC as I think it will seem foreign to a lot of devs. > > When I make traditional PHP "accessor" methods, I have complete control; if I want getFoo() to set private $foo without calling setFoo(), I can. Not so with real accessors. Probably a good thing :) > > One more concern, sorry if it was covered already: will case-insensitivity of methods mean you can't define getters for both $foo and $Foo? > > Steve -- -Clint --------------010905000103060305050403--