Re: [RFC] Alternative typehinting syntax for accessors
| From: | Anthony Ferrara | Date: | Sun, 06 Jan 2013 00:06:32 +0000 |
| Subject: | Re: [RFC] Alternative typehinting syntax for accessors | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64580@lists.php.net to get a copy of this message | ||
Stas,
> I think this is way too much magic. This means default is no longer a
> default, but instead some obscure flag that somehow is carried over to
> the setter. I do not think redefining initialization as permitting nulls
> is a good idea, initialization and value set are two different things.
"Too much magic"? It's completely consistent with how method parameters
work now. In fact, I'd argue that introducing a new syntax for this would
be inconsistent with the current paradigm.
This becomes especially true if initializers are added, where the property
would be initialized to a non-null value. Hence adding the ability for it
to *never* actually *be* null in the first place...
Anthony