Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56742 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88651 invoked from network); 4 Dec 2011 00:33:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2011 00:33:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 74.115.204.41 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 74.115.204.41 relay-hub205.domainlocalhost.com Received: from [74.115.204.41] ([74.115.204.41:11822] helo=relay-hub205.domainlocalhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/A2-04621-2FFBADE4 for ; Sat, 03 Dec 2011 19:33:56 -0500 Received: from MBX201.domain.local ([169.254.1.105]) by HUB205.domain.local ([74.115.204.41]) with mapi id 14.01.0289.001; Sat, 3 Dec 2011 19:33:51 -0500 To: "internals@lists.php.net" Thread-Topic: Patch: getters/setters syntax Implementation Thread-Index: AcyyHFLpWHG9PY58StafgrdW825Otw== Date: Sun, 4 Dec 2011 00:33:50 +0000 Message-ID: <9570D903A3BECE4092E924C2985CE485399460CA@MBX201.domain.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.64.23] Content-Type: multipart/alternative; boundary="_000_9570D903A3BECE4092E924C2985CE485399460CAMBX201domainloc_" MIME-Version: 1.0 Subject: Patch: getters/setters syntax Implementation From: cpriest@zerocue.com (Clint M Priest) --_000_9570D903A3BECE4092E924C2985CE485399460CAMBX201domainloc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Per RFC: https://wiki.php.net/rfc/propertygetsetsyntax Alright, getters/setters has been built. This is my first patch to the php= core. Here is what has been implemented: http://www.clintpriest.com/patches/accessors_v1.patch (patch against trunk) Asymmetrical getters/setters syntax: public $Hours { public get { return $this->_Hours; } protected set { $this->_Hours =3D $value; } } Default getter/setter implementations: private $Hours { /* Implements private $__Ho= urs; */ public get; /* { return $this->__= Hours; } public set; /* { $this->__Hours = =3D $value; } } Interfaces (Forces implementation by implementing classes): private $Hours { get; set; } Traits: No changes necessary, implementation worked without further chan= ges Errors: Updated errors to refer to getter/setter implementation when rela= ted Note: This does not interfere with typical __get()/__set() functionality which wi= ll take effect whenever there is not a specific getter/setter written. I have also included 8 .phpt test files which tests the new functionality What are the next steps to get this added to some future release? --_000_9570D903A3BECE4092E924C2985CE485399460CAMBX201domainloc_--