Hi Thomas,

> On 15 Jan 2015, at 22:25, Thomas Bley <ma...@thomasbley.de> wrote:
> 
> I think the problem with the current rfc is:
> 
> test(42);
> function test(string $a) does test((string)$a);
> function test(array $a) does not test((array)$a); although casting would be 
> possible.
> 
> So for consistency we might change the syntax or adapt array/object type 
> hints with casting (BC-break).

Having it do an explicit cast would make the feature really dangerous. Explicit 
casts can’t fail (except for objects, for whatever reason) and so they’ll 
completely mangle input if it’s bad. Implicit casts can fail.

I don’t think this would be a good approach.

Thanks.
--
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