Re: Re: Patch: getters/setters syntax Implementation
| From: | Nikita Popov | Date: | Wed, 07 Dec 2011 06:17:15 +0000 |
| Subject: | Re: Re: Patch: getters/setters syntax Implementation | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56819@lists.php.net to get a copy of this message | ||
The implementation specifically didn't introduce T_GET/T_SET on the
lexer side and instead checks for T_STRINGs with content "get" or
"set".
Nikita
On Wed, Dec 7, 2011 at 3:29 AM, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> Hi!
>
>
>> I believe the attempt with the RFC was to mimic the syntax that C#
>> went with, the RFC is here:
>> https://wiki.php.net/rfc/propertygetsetsyntax
>
>
> Reading this RFC I notice it makes get/set keywords. This would lead to
> huge amount of breakage in existing code, so I strongly suggest to look
> for another way. For example, __get and __set...
>
> I'm also not a big fan of magic $value variable coming from nowhere and
> function syntax without function definition. What if you want a getter to
> return by-reference? Or setter to get parameter by reference?
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>