Re: RFC: C-sharp style property get/set syntax for PHP
| From: | Kalle Sommer Nielsen | Date: | Sun, 05 Dec 2010 17:38:12 +0000 |
| Subject: | Re: RFC: C-sharp style property get/set syntax for PHP | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50855@lists.php.net to get a copy of this message | ||
Hi Dennis
2010/12/5 <president@basnetworks.net>:
> Interesting. So you are saying that once a word is a keyword in PHP, it
> cannot be used as a name, anywhere? So for example, you are saying I
> cannot create a variable called $function? If that is the case, that is
> extremely odd. I would expect that get/set could be keywords when used in
> the right location (inside a property definition, but outside of the
> property body), but anywhere else they should be able to be used as a
> regular name... Is there some way that could be possible?
A keyword in PHP means that it cannot be used as a name for something
like a class/method/function etc. but of course still allowed in
variable and constants (defined using define() -- not const as its
compile time).
class global { } /* fatal error */
function default() { } /* fatal error */
--
regards,
Kalle Sommer Nielsen
kalle@php.net