Re: Allow exceptions in __toString()

From: Date: Sun, 05 Jul 2015 20:33:47 +0000
Subject: Re: Allow exceptions in __toString()
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-87033@lists.php.net to get a copy of this message
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 understand an predict, so let's add more!" >> > > That, or "Let's not be hypocrites". I don't think the position of "let's not add more unpredictable behavior to the engine" is adequately described as "hypocrite". We know there are interruption problems and such in the engine, we know some of them are hard to fix. However, adding a different class of those doesn't make it better in any way. If we find a solution that allows us to not introduce new unpredictable behaviors - I'm all for it, it's great. Maybe the code that allows to throw exceptions the same way we do with errors, maybe some way to not get unpredictable results on conversions. But we can't just ignore it because there are other problems in the engine too. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#87033) next »