Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63670 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49997 invoked from network); 27 Oct 2012 18:15:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2012 18:15:02 -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:51401] helo=mail.zerocue.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/EC-51104-5A42C805 for ; Sat, 27 Oct 2012 14:15:01 -0400 Received: from [172.17.0.122] (unknown [72.179.52.187]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.zerocue.com (Postfix) with ESMTPSA id 8CF45120165 for ; Sat, 27 Oct 2012 18:14:58 +0000 (UTC) Message-ID: <508C249D.1000309@zerocue.com> Date: Sat, 27 Oct 2012 13:14:53 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: internals@lists.php.net References: <508A67E6.2000405@zerocue.com> <508A9AC9.50200@sugarcrm.com> <508AF3E7.7020004@sugarcrm.com> <508B1EA2.8060203@sugarcrm.com> In-Reply-To: <508B1EA2.8060203@sugarcrm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability From: cpriest@zerocue.com (Clint Priest) On 10/26/2012 6:37 PM, Stas Malyshev wrote: > Hi! > >> Stas, if you define an accessor, how do you define it? Do you say > Either way, doesn't matter. > >> According to the current proposal at least you can write the first >> code *and the first code only*. If you write the second code then you > That's where I think it is wrong. It would be much simpler and > consistent with existing PHP if it were a natural extension of __get > instead of a completely new and foreign concept. > >> special behavior for properties. You probably won't start off with >> telling them that this declaration is automatically converted to a set >> of __getFoo methods which are registered as handlers for the accessor. >> I really don't see how going into details like __getFoo makes anything >> easier. > Depending on your purpose and background. If you know how __get works, > extrapolating to __getFoo is trivial. Getting special syntax that > produces __getFoo from this is also trivial. > > Getting the concept of methods that are not quite methods and get called > only through special intercept mechanism and have special backtrace > rewriting engine and reflection hiding patches so you can be inside the > method that officially does not exist - not so trivial. The only thing that does back patching is for static accessors and you've already pointed out that what I was doing to make that happen is just going to break and fail in so many ways. What is "reflection hiding patches" referring to? Reflection is changed to reflect what the user has defined, that's what reflection is supposed to be.. no? Lastly, this idea that accessors is such a foreign concept is a bit ridiculous. You'd be hard pressed to find a modern/popular language these days that doesn't have them, so if someone is confused about what an accessor is then they probably have their head in the sand, god forbid they'd have to read the manual. -- -Clint