RE: [PHP-DEV] [RFC] Scalar Type Hints v0.2
| From: | Zeev Suraski | Date: | Wed, 14 Jan 2015 09:41:08 +0000 |
| Subject: | RE: [PHP-DEV] [RFC] Scalar Type Hints v0.2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80450@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Andrea Faulds [mailto:ajf@ajf.me]
> Sent: Wednesday, January 14, 2015 11:33 AM
> To: Leigh
> Cc: PHP Internals List
> Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2
>
> Hi Leigh,
>
> > On 14 Jan 2015, at 09:17, Leigh <leight@gmail.com> wrote:
> >
> > I really don't like this behaviour being changed at the call site. If
> > I design a function that I _know_ should only take a string, then I
> > want it to be an error if the user supplies anything else, so that
> > they know they messed up.
>
> I don’t like the idea of being forced to use strict (or weak) type
> checking
> because the API author decided as much.
I don't either. But I don't like the user to do it either, it's something
that is a part of the language definition.
I completely agree with both Robert and Leigh. I liked the v0.1 one, but
v0.2 is DOA from my point of view. Arguably, from my POV, it's the one
option that's even worse than having strict typing exclusively.
Zeev