Re: [RFC] Scalar Type Hints v0.2
| From: | Andrea Faulds | Date: | Wed, 14 Jan 2015 22:33:11 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints v0.2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80500@lists.php.net to get a copy of this message | ||
Hi Marcio,
> On 14 Jan 2015, at 18:52, Marcio Almada <marcio.web2@gmail.com> wrote:
>
> We still have a BC break but now we also have code with **mutant** behavior that might become
> buggy (do unexpected things) if a
declare is used. As a language
> user and a package maintainer it would be a huge problem. Imagine how would be to maintain a package
> that can be used with both strict and coercive type checking. We would have to write 2x more tests
> and yet pollute code with manual type checks (is_string, is_integer) for the non strict runtime
> mode when type check is necessary.
I don’t see why this would create “mutant” or “buggy” behaviour. You always get the type
you ask for: the weak behaviour is precisely the same as in v0.1. The strict behaviour is fairly
intuitive. In no case will you ever receive the wrong type.
I don’t understand.
--
Andrea Faulds
http://ajf.me/