Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63279 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74747 invoked from network); 8 Oct 2012 12:43:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Oct 2012 12:43:04 -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.80 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 74.115.204.80 relay-hub206.domainlocalhost.com Received: from [74.115.204.80] ([74.115.204.80:16405] helo=relay-hub206.domainlocalhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/6A-07529-65AC2705 for ; Mon, 08 Oct 2012 08:43:03 -0400 Received: from MBX202.domain.local ([169.254.169.44]) by HUB206.domain.local ([192.168.68.50]) with mapi id 14.02.0283.003; Mon, 8 Oct 2012 08:42:25 -0400 To: "internals@lists.php.net" Thread-Topic: [PHP-DEV] [RFC] Propety Accessors v1.1 Thread-Index: Ac2lRqaw0wLAVcGGQAyyWuaNO91x4QAC3O5Q Date: Mon, 8 Oct 2012 12:42:24 +0000 Message-ID: <9570D903A3BECE4092E924C2985CE485612B3B76@MBX202.domain.local> References: <9570D903A3BECE4092E924C2985CE485612B3B48@MBX202.domain.local> In-Reply-To: <9570D903A3BECE4092E924C2985CE485612B3B48@MBX202.domain.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.64.25] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] [RFC] Propety Accessors v1.1 From: cpriest@zerocue.com (Clint Priest) As an update, just ran some performance testing: master Cycles Direct Getter __get v1.4 @ 10/8/2012 1m .05s .21s .20s php 5.5.0-dev Cycles Direct Getter __get v1.4 @ 10/8/2012 1m .04s n/a .21s Performance of property accessors was important to me as I'm sure it will b= e to many, on one million cycles of a simple getter, it's <.01s difference.= Depending on the run it is sometimes exactly the same performance. > -----Original Message----- > From: Clint Priest [mailto:cpriest@zerocue.com] > Sent: Monday, October 08, 2012 6:53 AM > To: internals@lists.php.net > Subject: [PHP-DEV] [RFC] Propety Accessors v1.1 >=20 > It's been a while since I posted any updates about this, a few individual= s have been asking about it privately and wanting me to get it > out the door for PHP 5.5 release. It's come a long way since the last ti= me I posted about it. >=20 > RFC Document: https://wiki.php.net/rfc/propertygetsetsyntax-as-implemente= d >=20 > Example Usage: >=20 > class TimePeriod { > private $Seconds =3D 3600; >=20 > public $Hours { > get { return $this->Seconds / 3600; } > set { $this->Seconds =3D $value; } > isset { return isset($this->Seconds); } > unset { unset= ($this->Seconds); } > } > } >=20 > Changes / Updates >=20 > * isset/unset accessor functions now implemented (object & static= context, auto implementations, etc) >=20 > * static accessor now fully functional >=20 > * Reference functionality validated, tests written >=20 > * All operators have been tested, tests written >=20 > * read-only and write-only keywords: Added explanation of reasons= for inclusion at the top of the appropriate RFC section >=20 > * Tested for speed, approaches or meets __get() speed. >=20 > Internally things have changed quite a bit >=20 > * cleaned up and simplified >=20 > * had been using 4 to 5 additional fn_flag slots, now down to two= (READ_ONLY and WRITE_ONLY) >=20 > * the automatic implementations now compiled internal php code, t= his greatly simplified that part of the code and future proofed > it. >=20 > The code is available at the url below and is up to date with master, all= tests pass. > https://github.com/cpriest/php-src >=20 > I'd like to get this project wrapped up in time to make it to the 5.5 rel= ease, only a few things remain to be completed/updated: >=20 > * Check on reflection code written prior to major changes (tests = still pass) >=20 > * Add a few more reflection functions that were requested >=20 > In total there are 79 tests for this new functionality, if there are any = others that I have missed, please let me know. >=20 > -Clint