Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64830 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39485 invoked from network); 10 Jan 2013 22:11:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2013 22:11:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.153 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.153 smtp153.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.153] ([67.192.241.153:39233] helo=smtp153.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/DF-02684-1AC3FE05 for ; Thu, 10 Jan 2013 17:11:45 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp15.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 0B3853004EE; Thu, 10 Jan 2013 17:11:42 -0500 (EST) X-Virus-Scanned: OK Received: by smtp15.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id A3250300379; Thu, 10 Jan 2013 17:11:41 -0500 (EST) Message-ID: <50EF3C9C.3020701@sugarcrm.com> Date: Thu, 10 Jan 2013 14:11:40 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Nikita Popov CC: PHP internals References: <4ED7146272E04A47B986ED49E771E347BB3D6ABCB3@Ikarus.ameusgmbh.intern> <50EC5F8F.8010703@mrclay.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Alternative typehinting syntax for accessors From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! The proposal is pretty clear, but could you explain this part: The current accessors proposal will need special handling of the typehint in any case (it can't be handled as a normal method typehint). What special handling is required? > One question that still needs to be discussed is what syntax regarding > parentheses we want to use if this makes it. Currently both set { } and > set($foo) { } style accessors are supported. Do we want to keep those two > with the new syntax? Within this context, I'd prefer getting rid of set {} and only have set($param) {}. You don't save that much typing and you do it at the cost of additional obscurity and complexity - now every developer and every tool that deals with it needs to remember there's hidden $value parameter. IMHO not worth it. I can see what "get;" gives you - you can say "just do the natural thing". But if you start writing code anyway - i.e. if you do {} - then I think it should look like a real function. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227