> -----Original Message-----
> From: John LeSueur [mailto:john.lesu...@gmail.com] 
> 
> Maybe this discussion should start from the end of the last discussion on 
> non-strict type hints, where really smart people came up with some options to 
> handle the conversion:
> 
> https://wiki.php.net/rfc/typecheckingstrictandweak#option_1_current_type_juggeling_rules_with_e_strict_on_data_loss
> 
> The RFC talks about throwing E_STRICT or E_FATAL, and has a couple of options 
> for a matrix of conversion rules.

I've actually read that proposal. To some level it is good, but I felt like 
there were too many problems. E_ERROR is overkill. For comparison, (function 
(array $bar) {})('a') generates a catchable fatal error (E_RECOVERABLE_ERROR) 
so that's the furthest this should go in any case, but when dealing with 
jugglable types and there's just some unexpected data loss even 
E_RECOVERABLE_ERROR is too much IMO; E_WARNING or E_NOTICE would be more 
appropriate. IIRC it also failed conversions too aggressively.

John Crenshaw
Priacta, Inc.

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

Reply via email to