Hi Julien,

> On 14 Jan 2015, at 10:14, Julien Pauli <jpa...@php.net> wrote:
> 
> Using declare() IMO, is a PITA.
> Everything that can be done without the use of declare(), must be done 
> without declare().
> 
> I would have prefered different syntax, like the ones we disccussed many 
> years ago , having strict checks with the foo(string $a) syntax, and 
> non-strict check with the foo((string) $a) syntax.

Actually, this approach came about mostly to avoid that. I don’t really like 
the idea of mixing and matching weak and strict type checks. Having some 
functions using (int) and (string), others use int and string, and others still 
use both, would be confusing. Plus, it would mean that you’d be forced to 
follow the personal preference of the API authors.

With this RFC, yes, you have to put an extra line at the top of the file. But 
it has the advantage that everything follows the same behaviour, even 
extension/built-in functions. That’s what I like about it.

--
Andrea Faulds
http://ajf.me/





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to