Re: What do we need strict scalar type hints for?
| From: | Sebastian Bergmann | Date: | Wed, 04 Feb 2015 09:31:24 +0000 |
| Subject: | Re: What do we need strict scalar type hints for? | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81794@lists.php.net to get a copy of this message | ||
Am 04.02.2015 um 10:25 schrieb Dmitry Stogov:
> Do you like the proposal with declare() switch?
No, I do not like that.
We are talking about adding support for scalars (string, integer, ...)
to the list of optional type declarations already supported (array,
callable, interface name, class name) by PHP. When a developer chooses
to use a scalar type in the signature of a function or method then it
should be enforced as strictly as the already supported types. It should
be up the caller to perform explicit type casting when required.