RE: [PHP-DEV] Scalar Type Hints v0.4
| From: | François Laupretre | Date: | Wed, 18 Feb 2015 18:09:57 +0000 |
| Subject: | RE: [PHP-DEV] Scalar Type Hints v0.4 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83101@lists.php.net to get a copy of this message | ||
> De : Patrick ALLAERT [mailto:patrickallaert@php.net]
>
> The biggest advantage, IMHO, is that you get the exact same result whether
> you do:
>
> foo((int) $value);
>
> or:
>
> foo($value);
>
> ... whatever the mode you are in.
Wrong. Parameter parsing rules are much more restrictive than casting rules.
Only 'foo((int)'orange')' would (erroneously) succeed.
François