Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-06 Thread Johannes Schlüter
On Sun, 2015-07-05 at 23:45 +0200, Nikita Popov wrote: > On Sun, Jul 5, 2015 at 10:51 PM, Nikita Popov > wrote: > On Sun, Jul 5, 2015 at 10:33 PM, Stanislav Malyshev > wrote: > Hi! > > >>> I can see your concern here -- however this

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-05 Thread Bob Weinand
> Am 05.07.2015 um 23:45 schrieb Nikita Popov : > On Sun, Jul 5, 2015 at 10:51 PM, Nikita Popov wrote: >> On Sun, Jul 5, 2015 at 10:33 PM, Stanislav Malyshev >> wrote: >> >>> Hi! >>> >> I can see your concern here -- however this is nothing specific to >> exceptions thrown from __toStri

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-05 Thread Nikita Popov
On Sun, Jul 5, 2015 at 10:51 PM, Nikita Popov wrote: > On Sun, Jul 5, 2015 at 10:33 PM, Stanislav Malyshev > wrote: > >> Hi! >> >> >>> I can see your concern here -- however this is nothing specific to >> >>> exceptions thrown from __toString(). There is are a number of ways you >> >>> can end u

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-05 Thread Nikita Popov
On Sun, Jul 5, 2015 at 10:33 PM, Stanislav Malyshev wrote: > Hi! > > >>> I can see your concern here -- however this is nothing specific to > >>> exceptions thrown from __toString(). There is are a number of ways you > >>> can end up in this situation, the two most common being: > >> > >> I summa

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-05 Thread Stanislav Malyshev
Hi! >>> I can see your concern here -- however this is nothing specific to >>> exceptions thrown from __toString(). There is are a number of ways you >>> can end up in this situation, the two most common being: >> >> I summarize this a bit freely as "We already have places which are hard >> to und

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-05 Thread Nikita Popov
On Sun, Jul 5, 2015 at 10:20 PM, Johannes Schlüter wrote: > On Fri, 2015-07-03 at 17:57 +0200, Nikita Popov wrote: > > > > I can see your concern here -- however this is nothing specific to > > exceptions thrown from __toString(). There is are a number of ways you > > can end up in this situation

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-05 Thread Johannes Schlüter
On Fri, 2015-07-03 at 17:57 +0200, Nikita Popov wrote: > I can see your concern here -- however this is nothing specific to > exceptions thrown from __toString(). There is are a number of ways you > can end up in this situation, the two most common being: I summarize this a bit freely as "We alr

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-03 Thread Stanislav Malyshev
Hi! > a) Error handlers can (and often do) throw. E.g. it is possible to convert > the two recoverable fatal errors that __toString() currently throws into > exceptions and end up in the situation you describe, only with even less > safety and more leaks. However this applies to all occurrences of

Re: [PHP-DEV] Allow exceptions in __toString()

2015-07-03 Thread Nikita Popov
On Thu, Jun 25, 2015 at 3:55 PM, Johannes Schlüter wrote: > On Thu, 2015-06-25 at 14:52 +0200, Nikita Popov wrote: > > However what it doesn't do, and what I wouldn't consider feasible to do, > is > > ensure that every single string conversion in library functions is > > exception safe. Personall

RE: [PHP-DEV] Allow exceptions in __toString()

2015-06-29 Thread Anatol Belski
Hi Nikita, > -Original Message- > From: Nikita Popov [mailto:nikita@gmail.com] > Sent: Thursday, June 25, 2015 2:53 PM > To: PHP internals; Dmitry Stogov > Subject: [PHP-DEV] Allow exceptions in __toString() > > Hi internals! > > Currently it's not possible to throw an exception from

Re: [PHP-DEV] Allow exceptions in __toString()

2015-06-25 Thread Stanislav Malyshev
Hi! > However what it doesn't do, and what I wouldn't consider feasible to do, is > ensure that every single string conversion in library functions is > exception safe. Personally I don't think this is a blocking issue, as the > worst that can happen is usually an additional superfluous warning to

Re: [PHP-DEV] Allow exceptions in __toString()

2015-06-25 Thread Dmitry Stogov
On Thu, Jun 25, 2015 at 4:55 PM, Johannes Schlüter wrote: > On Thu, 2015-06-25 at 14:52 +0200, Nikita Popov wrote: > > However what it doesn't do, and what I wouldn't consider feasible to do, > is > > ensure that every single string conversion in library functions is > > exception safe. Personall

Re: [PHP-DEV] Allow exceptions in __toString()

2015-06-25 Thread Johannes Schlüter
On Thu, 2015-06-25 at 14:52 +0200, Nikita Popov wrote: > However what it doesn't do, and what I wouldn't consider feasible to do, is > ensure that every single string conversion in library functions is > exception safe. Personally I don't think this is a blocking issue, as the > worst that can happ