Francois, On Fri, Feb 20, 2015 at 8:14 PM, François Laupretre <franc...@php.net> wrote: > Hi Anthony, > > I guess you would keep supporting __toString() ? So, you should probably > consider 'string' as 'string|object'. > Adding this case to 'float' meaning 'int|float' and 'callable' resolving to > 'string|array|object', are you sure it's worth the pain implementing and > supporting a dual-mode mechanism, compared to the ruleset I am intending to > propose (currently in draft): https://wiki.php.net/rfc/zpp-conversion-rules ?
No. The rules are quite clearly explained in the RFC. The only thing that can resolve a string hint is a string. __toString is a form of cast, and hence disallowed in strict mode (because 1: it's not explicit, 2: it loses significant information). Callable is an existing rule, which is not subject to the "strict" discussion. > Actually, using such ruleset, I guess you could infer less, but the > difference wouldn't be so important. > > Only 3 conversions still use value, from which one can be made > type-dependent-only if requested during discussion (float to int proposed as > lossless-only). Every type except int, float, and string are also proposed as > 100% strict. None of the conversions use "value". Int, Float, String and Bool all behave precisely about type. No runtime value information is used (only runtime type info). Please read the proposal and see what it says. Don't judge it by what you assume, but by what it says. Anthony -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php