Re: [RFC] Scalar Type Hints v0.2
| From: | Christoph Becker | Date: | Thu, 15 Jan 2015 01:07:36 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints v0.2 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80509@lists.php.net to get a copy of this message | ||
Andrea Faulds wrote:
> From what I can see, the larger PHP community is generally in favour
> of strict typing, and among them, the previous RFC revision was
> received quite poorly. Myself, I might have been somewhat happy with
> just weak hints, but it would upset an awful lot of developers who
> would like some measure of strict typing. Developers who would most
> likely not use the new scalar type hints, because they weren’t
> strict. And if nobody uses them, why add them?
>
> This revision hopes to possibly placate both weak and strict typing
> advocates. Of course, it also will lose some support in that it
> allows a choice. Plus, it gives the user choice, not the API
> designer, which I expect will be somewhat controversial. But I am
> hopeful.
Just a thought: what about having weak scalar type hints which throw
E_STRICT_TYPE if a value of another type is passed?
--
Christoph M. Becker