On 13 Jul 2014, at 18:56, Larry Garfield <la...@garfieldtech.com> wrote:

> We can discuss when the E_* should be emitted separately from what the cast 
> result is.

Is there any actual controversy over what the *result* of casts should be. This 
RFC just has the normal casting result. Is anyone really in disagreement there?

> As long as it's an error of some kind it may be OK, but perhaps we want to 
> leave array as is (strict behavior) rather than changing it to the primitive 
> logic (cast behaviour)?

I think the discussion about how arrays should be casted too for consistency is 
a bit silly. What makes sense for non-scalar types (strict hinting) may not 
work so well for scalar types; casting to array is rarely useful, while casting 
to the scalar types is readily. Also, frankly, function foobar((int) $a, array 
$b) is inconsistent and ugly.

Note too that the non-scalar types, while they can be casted from, can’t always 
be casted to. You can cast to an object, but only StdClass, and you can’t cast 
to resource at all.

I really don’t think there’s anything wrong with having one system for the 
scalar types and one for the non-scalar types since they’re so different.
--
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