2015-02-19 12:26 GMT+01:00 François Laupretre <franc...@php.net>:
> Hi Patrick,
>
> I know you didn’t decide it alone, but the right solution, IMO, would have
> been to E_DEPRECATE nonsense conversions. That’s what we are currently doing
> for ZPP conversions (https://wiki.php.net/rfc/zpp-conversion-rules). I also
> proposed this for array to string (https://wiki.php.net/rfc/array-to-string)
> but should probably extend it to other conversions that generate E_NOTICE,
> at least.

For a new major version, it perfectly make sense and I am with you on
refactoring this.

Take into account that casting an object (without __toString()
implementation) to string will generate an E_RECOVERABLE_ERROR (at one
moment [1], it generated the string "Object"! That was quickly change
to generate an error, but the array to string conversion did not
benefit of the same change and survived much longer).

As you suggest, I think it would be good to extend it to other
conversions so that it might be unified a bit.

[1] 
https://github.com/php/php-src/commit/da9faa2c3a7db0f222e751e899c843a1f6561e8b#diff-b09edfedd835ebc4491e565c147190e7R133

Thanks,
Patrick

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

Reply via email to