Re: [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters
| From: | Anthony Ferrara | Date: | Mon, 12 Mar 2012 14:12:50 +0000 |
| Subject: | Re: [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-58878@lists.php.net to get a copy of this message | ||
Lazare,
> The patch of Anthony, clearly states that this is accepted:
>
> function foo ( int $bar = null ) { }
>
> And this is what I called an int|null.
Yup, it does. Because that's the current behavior with array and
object casting. If you default it to null in the declaration, null is
a valid value. If you don't, it's not...