Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60256 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50132 invoked from network); 22 Apr 2012 03:48:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2012 03:48:34 -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.51 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 74.115.204.51 migration-relay.domainlocalhost.com Received: from [74.115.204.51] ([74.115.204.51:6188] helo=relay-hub201.domainlocalhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/15-28308-09F739F4 for ; Sat, 21 Apr 2012 23:48:33 -0400 Received: from MBX202.domain.local ([169.254.19.147]) by HUB201.domain.local ([192.168.69.1]) with mapi id 14.01.0355.002; Sat, 21 Apr 2012 23:48:28 -0400 To: Stas Malyshev CC: "internals@lists.php.net" Thread-Topic: [PHP-DEV] RFC: Property get/set syntax Thread-Index: AQHNHr9pMXjVRwJgf0WuCXUx2dlgNpamIqQwgABUPgD//8A9QA== Date: Sun, 22 Apr 2012 03:48:27 +0000 Message-ID: <9570D903A3BECE4092E924C2985CE48555BE665A@MBX202.domain.local> References: <9570D903A3BECE4092E924C2985CE485546B0737@MBX202.domain.local> <4F910311.7040406@sugarcrm.com> <9570D903A3BECE4092E924C2985CE48555BE6562@MBX202.domain.local> <4F937C00.3090104@sugarcrm.com> In-Reply-To: <4F937C00.3090104@sugarcrm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.64.26] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] RFC: Property get/set syntax From: cpriest@zerocue.com (Clint M Priest) > -----Original Message----- > From: Stas Malyshev [mailto:smalyshev@sugarcrm.com] > Sent: Saturday, April 21, 2012 10:33 PM > To: Clint M Priest > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] RFC: Property get/set syntax >=20 > Hi! >=20 > > empty() - Returns true for a property retrieved via __get() or via a > > getter -- Any idea why this would be the case for __get()? Is this a > > bug? >=20 > isset() calls __isset(), empty() calls __isset() and __get(). I'm not sur= e what exactly you consider to be a bug. I see, well the only way to resolve this would be to add isset and unset pr= operty functions as well. Anyone against it? >=20 > > unset() - Would unset a temporary variable (the one returned by the > > getter) -- see previous email re: adding unset/isset property > > functions. >=20 > unset() calls __unset(). >=20 > > sort() - Does the same thing as with __get()/__set() which is to say, > > the array is sorted but the property is not updated with the value. > > Should accessor behave differently than the magic methods? Should > > this just be documents or should this be fixed? >=20 > sort() works just fine if you define __get to return by-ref. Returning by reference was not documented in the original RFC, would this s= yntax work for everyone? public $Hours { &get { return $this->a; } } >=20 > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227