Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84461 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45958 invoked from network); 9 Mar 2015 10:52:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2015 10:52:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=jacob.bednarz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jacob.bednarz@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.43 as permitted sender) X-PHP-List-Original-Sender: jacob.bednarz@gmail.com X-Host-Fingerprint: 209.85.192.43 mail-qg0-f43.google.com Received: from [209.85.192.43] ([209.85.192.43:44442] helo=mail-qg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/F9-29848-17B7DF45 for ; Mon, 09 Mar 2015 05:52:33 -0500 Received: by qgfl89 with SMTP id l89so27218287qgf.11 for ; Mon, 09 Mar 2015 03:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3PBYnzgCVXCr7+v8mn1gzkGaiMG6MMXAuQw3Rhnv468=; b=GG7ORDR8ADxlNVEkdcz2fWmysg/66uXCJYMYwL32dy8cq7iyvmzvmcaNHPfWjDbSzl 7AOcgcfUCHwhC4Y2lma8d6hemQHSzX9wEXYuWMAgagMpQymGaF/cN3cjvohGE5HH/t+/ oYYBKkCp8rKMagpFbrxQVXNIE6f7wxJ2hwYjSJ1fYku6JLH7JYt9CTmTbyWS6p+0M5wA GMDSMZivBpyfTHZttvULwIdmR8CcuG7MIU3DmjcACq2lHwgmY/EHQ7vKxE3Nl1wbUicb RfjnMUlEV9wyYP/xUmJiiYMDC+zVwYRMqaMo+b++t042w+hITXKItV2XRyc/b/CoWyCJ 6BKg== MIME-Version: 1.0 X-Received: by 10.140.44.97 with SMTP id f88mr33186159qga.88.1425898350087; Mon, 09 Mar 2015 03:52:30 -0700 (PDT) Received: by 10.140.43.100 with HTTP; Mon, 9 Mar 2015 03:52:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 9 Mar 2015 20:52:30 +1000 Message-ID: To: Shawn McCool Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11397d96a496280510d8d46c Subject: Re: [PHP-DEV] Request Feedback for Instance Variable Sugar RFC From: jacob.bednarz@gmail.com (Jacob Bednarz) --001a11397d96a496280510d8d46c Content-Type: text/plain; charset=UTF-8 Hey Shane, The @ symbol in PHP is currently an error control operator[1]. Does that mean you will be reassigning the error control operator to another character? [1]: http://php.net/manual/en/language.operators.errorcontrol.php On Monday, March 9, 2015, Shawn McCool wrote: > I've never submitted an RFC. Whether or not you're interested in the > feature, please consider giving me feedback on the RFC itself so that I can > better understand how to succeed in the process. > > ====== PHP RFC: Instance Variable Sugar ====== > * Version: 0.1 > * Date: 2015-03-09 > * Author: Shawn McCool, shawn@heybigname.com > * Status: In Discussion > > ===== Summary ===== > > In order to access instance variables, one must use the `$this->` prefix. > The problem with this is that it reduces expressiveness in the language and > increases the amount of unnecessary decoration, reducing readability. > > This RFC proposes a single character syntax sugar form of `$this->`. > Instead, an `@` can be used to reference instance variables. > > The @ replaces the normal $ variable prefix. > > ===== Example ===== > > > class Addition { > private $number > > public function __construct($number) { > @number = $number; > } > > public function original() { > return @number; > } > > public function addTo($amount) { > return @number + $amount; > } > } > > > ===== Backwards Compatibility ===== > > Leave `$this->` available. > > ===== Proposed PHP Version(s) ===== > > This is proposed for the next PHP x, currently PHP 7. > > -- > Shawn McCool | Big Name > shawn@heybigname.com > heybigname.com > --001a11397d96a496280510d8d46c--