Re: [RFC] Alternative typehinting syntax for accessors
| From: | Stas Malyshev | Date: | Sat, 05 Jan 2013 22:33:49 +0000 |
| Subject: | Re: [RFC] Alternative typehinting syntax for accessors | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64564@lists.php.net to get a copy of this message | ||
Hi!
>> typehints, i.e. allow NULL when NULL is specified as the default value. So
>>
public DateTime $date; would not allow an explicit NULL
>> assignment,
>> whereas public DateTime $date = NULL; would.
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.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227