Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65057 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81347 invoked from network); 21 Jan 2013 19:28:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jan 2013 19:28:15 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:53636] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/21-08138-EC69DF05 for ; Mon, 21 Jan 2013 14:28:15 -0500 Received: by mail-vc0-f180.google.com with SMTP id fo13so1186946vcb.25 for ; Mon, 21 Jan 2013 11:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=WqnespnWv4qVrxq3qOqTqYAJqwYGOG+f+V9LFL/oK3E=; b=Lcol0U1vUSWeHYhiO0JAhepaSb3yNOIv+gk6JcNLUkuN5wcuX3XKkQneATXdTtw06z bhQzA4rcNicQG7HpKXG8af/hks5W7CRavbvSQjuUlRFWuLe6A6y3vw52bTTy868fQ1A5 npn/TB+o3zG/QbUwPzps2jn1vddRj1s+8KlhncD0S1DZ4gkSYZyPYlpgeG0K3N0aPjer kdzM7a2oV46bUypvgUKTknSmlPZWisen/rp+iJTtwO7r2OdXOIacMpWx342/yiJPZDsQ SeTWBQ1EANwtX72wYn+7Ah72ZU2O8fXfEgECi6e6IhtHsrxw+LNyvyKPr/kehzwRBM6z C9mg== MIME-Version: 1.0 X-Received: by 10.52.98.98 with SMTP id eh2mr18091405vdb.64.1358796492334; Mon, 21 Jan 2013 11:28:12 -0800 (PST) Received: by 10.58.173.4 with HTTP; Mon, 21 Jan 2013 11:28:12 -0800 (PST) In-Reply-To: References: Date: Mon, 21 Jan 2013 14:28:12 -0500 Message-ID: To: Gustavo Lopes Cc: PHP internals , Nikita Popov Content-Type: multipart/alternative; boundary=20cf307f380a3f666704d3d176dd Subject: Re: [PHP-DEV] [VOTE] Alternative typehinting syntax for accessors From: ircmaxell@gmail.com (Anthony Ferrara) --20cf307f380a3f666704d3d176dd Content-Type: text/plain; charset=ISO-8859-1 Gustavo I've voted "No" due to concerns I mentioned in most part in IRC, but which > I think should be here on the record. So my voting statement: > > I'm voting against this proposal because I think the proposed syntax > strongly suggests that the property is bound to a specific type. This has > several problems: > > * It's a promise that's not guaranteed. As long as the getter is allowed > to reference the value of the variable can arbitrarily be changed to > whatever type. It may also be possible to do the same with unserialization. > This is pretty easily solved by removing the ability to return a reference from the getter when the shortcut syntax is used. In fact, remove the ability to set the body of a getter at all (it would only allow you to specify the visibility. If you need references, you can't use this syntax... > * The benefits are minimal. The only real benefit is cutting maybe two > lines of code in an indisputably common scenario. > Cutting two lines of code per instance. And considering that this is used all the time, that can add up to some pretty significant (if not trivial) boilerplate that's removed... Anthony --20cf307f380a3f666704d3d176dd--