Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84485 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27582 invoked from network); 9 Mar 2015 21:27:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2015 21:27:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:43471] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/70-23562-5201EF45 for ; Mon, 09 Mar 2015 16:27:02 -0500 Received: by widem10 with SMTP id em10so10643211wid.2 for ; Mon, 09 Mar 2015 14:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=dmSkb47kG6YUrV0Q3nExVtRI017aL3e2dp6UMl/bmlw=; b=GupaCmFgvIpy7NURhHwlt5/aKSRUWP2vmqlmubD0hEHYOmMZm2I/b5aoFBJ3w3dTIl 5PgU/FhH+c4QgFtNiEX/F5ewlQm8FpJV1nwWpelb42qNXEbS9YCO9Oj5Kz6BvibjX3zg l107oY4FTleAspUO0f2DnXR5TZoSkvBdR+AFTeZPKM0C+FDS/JA2CiErN15eymVchDvi qs8XKV37s6YTHgq4J19wKlhd3t9KApaVKSfouoNi6WVJU2ydm/FqmjOT/9V6bRZh0Rhm L62OFAuIU+kFB9K+DsU2FGTZPYokncALBOahpEe/x33ME086leprRPyFnJNctgaEdnDt HqSw== X-Received: by 10.180.13.145 with SMTP id h17mr23575539wic.38.1425936419066; Mon, 09 Mar 2015 14:26:59 -0700 (PDT) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id dm6sm858515wib.22.2015.03.09.14.26.57 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Mar 2015 14:26:58 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Mon, 09 Mar 2015 21:26:54 +0000 To: Shawn McCool ,internals@lists.php.net Message-ID: Subject: Re: [PHP-DEV] Request Feedback for Instance Variable Sugar RFC From: rowan.collins@gmail.com (Rowan Collins) On 9 March 2015 09:43:32 GMT, Shawn McCool wrote: >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. I disagree with this premise. The $this here is not just decorative syntax, it's an actual variable, which can be passed around just like any other variable. The -> is then the standard way of accessing a property or method, applied to that variable. This is beautifully simple, and expresses what's going on perfectly: if you look at $this->foo, and ask "which foo is being referenced here?", the answer is clearly "the one which is a property of $this". The only places I can see value in a shorthand are in constructors and setters, where you're just copying from one name to another ($this->foo = $foo). But the part that's redundant there is the variable/property names, not the $this, so what you need is getter/setter support, or shorthand constructors (you should be able to find previous RFCs for both). Regards, -- Rowan Collins [IMSoP]