Re: [RFC] Scalar Type Hints v0.2

From: Date: Thu, 15 Jan 2015 11:30:48 +0000
Subject: Re: [RFC] Scalar Type Hints v0.2
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-80532@lists.php.net to get a copy of this message
On 15 Jan 2015, at 0:33, Andrea Faulds <ajf@ajf.me>: 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 Fauld s Hello Andrea! Consider what a mess was register_globals and problems it had, but at least it was a global setting. Declare will work on per file basis, and it will end up even more of a mess. I think PHP development community learned that lesson and that's why you get pushback, and not only from internals, but also from the userland. Me including. Rergards, Arvids.

« previous php.internals (#80532) next »