Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-15 Thread Matteo Beccati
On 15/05/2019 21:00, Nikita Popov wrote: While checking every single string conversion certainly puts you on the safe side, leaving out these checks will usually only result in some unneeded computation and possibly redundant warnings. The main thing you should watch out for are operations modif

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-15 Thread Nikita Popov
On Wed, May 15, 2019 at 7:55 PM Matteo Beccati wrote: > Hi Dan, > > On 15/05/2019 03:15, Dan Ackroyd wrote: > > Immediately nothing. > > > > Eventually, when a __toString() method throws an exception, and the > > extension doesn't check for an exception being throw, bad things will > > happen. >

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-15 Thread Matteo Beccati
Hi Dan, On 15/05/2019 03:15, Dan Ackroyd wrote: Immediately nothing. Eventually, when a __toString() method throws an exception, and the extension doesn't check for an exception being throw, bad things will happen. But in my opinion, if people don't understand the implications of the RFC even

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-14 Thread Dan Ackroyd
On Tue, 14 May 2019 at 17:55, Matteo Beccati wrote: > > Perhaps the section can be expanded to illustrate to non-internal people > how much work it is to upgrade the average extension or what happens if > they don't. > It will vary per extension. For some it will be none. For others it will be 's

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-14 Thread Matteo Beccati
Hi Christoph, On 14/05/2019 16:13, Christoph M. Becker wrote: On 14.05.2019 at 15:52, Matteo Beccati wrote: How would the change affect extension developers? See . Perhaps the section can be expanded to illustrate to non-int

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-14 Thread Christoph M. Becker
On 14.05.2019 at 15:52, Matteo Beccati wrote: > On 14/05/2019 12:44, Nikita Popov wrote: > >> The target is 7.4 because the BC break is minimal and largely >> theoretical. >> I think the main affected code will be Symfony's existing hack around the >> issue -- they'll have to disable the hack for

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-14 Thread Matteo Beccati
Hi Nikita, On 14/05/2019 12:44, Nikita Popov wrote: The target is 7.4 because the BC break is minimal and largely theoretical. I think the main affected code will be Symfony's existing hack around the issue -- they'll have to disable the hack for PHP >= 7.4 and just use the native support. How

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-14 Thread Nikita Popov
On Mon, May 13, 2019 at 5:08 PM Andreas Heigl wrote: > Hey Nikita, hey all > > Am 13.05.19 um 16:05 schrieb Nikita Popov: > > On Tue, Apr 30, 2019 at 3:32 PM Nikita Popov > wrote: > > > >> Hi internals, > >> > >> I've already brought up this topic on list a couple of weeks ago... I've > >> now u

Re: [PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-13 Thread Andreas Heigl
Hey Nikita, hey all Am 13.05.19 um 16:05 schrieb Nikita Popov: > On Tue, Apr 30, 2019 at 3:32 PM Nikita Popov wrote: > >> Hi internals, >> >> I've already brought up this topic on list a couple of weeks ago... I've >> now updated the implementation based on feedback at the time, and turned >> th

[PHP-DEV] Re: [RFC] Allow throwing exceptions from __toString()

2019-05-13 Thread Nikita Popov
On Tue, Apr 30, 2019 at 3:32 PM Nikita Popov wrote: > Hi internals, > > I've already brought up this topic on list a couple of weeks ago... I've > now updated the implementation based on feedback at the time, and turned > this into a proper RFC: > > https://wiki.php.net/rfc/tostring_exceptions >