Re: [RFC] Scalar Type Hints v0.2
| From: | Arvids Godjuks | Date: | Wed, 14 Jan 2015 15:25:34 +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-80467@lists.php.net to get a copy of this message | ||
2015-01-14 16:00 GMT+02:00 Pavel Kouřil <pajousek@gmail.com>:
> Hello,
>
> personally, as a language user, I really dislike the idea of both
> options for scalar type hinting to be the part of the language.
> Especially since you would have to declare the strict typing in each
> file (if you are going by 1 class per file in a bigger project, that's
> a LOT of declare directives to write in the long run) and if you'd
> forgot once, it would make the calling of methods somehow
> inconsistent.
>
> I wish there was just one way to do it; I don't care if the weak or
> strong variant is going to be accepted, IMHO most programmers will be
> able to adapt to either of them. The weak version makes probably more
> sense for PHP and how it handles scalar types (at least from userland
> developer's standpoint), but either of them is better than no
> typehints at all. :)
>
> PS: Personally, I find the "scalar" typehint idea useless and cannot
> find a real use case for it. Richard, would you mind giving an
> example?
>
> Regards
> Pavel Kouril
As a userland developer, have to agree with this message fully.
-1 on the v0.2 version, the declare() approach is gonna make our job
misserable after a few years when this gets adopted and misused by a lot of
people...