Re: Typehints (was Re: [PHP-DEV] Annoucing PHP 5.4 Alpha 1)
| From: | Josh Davis | Date: | Tue, 10 Aug 2010 23:42:07 +0000 |
| Subject: | Re: Typehints (was Re: [PHP-DEV] Annoucing PHP 5.4 Alpha 1) | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49296@lists.php.net to get a copy of this message | ||
Derick's point was about consistency. The approach described in his
mail is consistent with current syntax and mechanism(s). Current
typehints do not apply any kind of conversion, so treating scalar
hints the same way is consistent with the current mechanism.
Reusing the typecasting syntax for typecasting "hints" makes them more
familiar to the users, and it is less ambiguous than a typehint that
sometimes also typecasts. Plus, it allows for both "strict"
typechecking and the more relaxed typecasting thing instead of forcing
one. And all of that with a syntax that feels familiar.
That, I believe, was his point.
-JD