Re: [RFC] Alternative typehinting syntax for accessors
| From: | Bernhard Schussek | Date: | Sat, 05 Jan 2013 10:38:28 +0000 |
| Subject: | Re: [RFC] Alternative typehinting syntax for accessors | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64544@lists.php.net to get a copy of this message | ||
2013/1/5 Nikita Popov <nikita.ppv@gmail.com>
> I think that's a very interesting question, thanks for bringing it up. I
> think a good approach here would be the same one used for function argument
> 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 was wondering about this question too. I really like that solution.
Bernhard