# __toString() and exceptions

- Thread: https://externals.io/message/37976
- Original archive: https://news-web.php.net/php.internals/37976
- Started by Sebastian on 2008-05-28T18:17:34+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #37976 — Sebastian — 2008-05-28T18:17:34+00:00

URL: https://externals.io/message/37976#37976

Hi,

i just found it's really annoying that you can't throw exception in the 
context of __toString(). This makes it nealy impossible to work with 
__toString() because you'll have to watch not to throw exceptions (which is 
even more annoying..). Could this be adressed?

Greetings

---

## #37979 — Guilherme Blanco — 2008-05-28T19:26:39+00:00

URL: https://externals.io/message/37976#37979 · In reply to: #37976

Hi Sebastian,


This is known and I already asked this quite some time ago.
Here is the summary of what have I asked here:
http://devzone.zend.com/article/2016-Zend-Weekly-Summaries-Issue-336#Heading6


Regards,


> Hi,
>
> i just found it's really annoying that you can't throw exception in the
> context of __toString(). This makes it nealy impossible to work with
> __toString() because you'll have to watch not to throw exceptions (which is
> even more annoying..). Could this be adressed?
>
> Greetings
>
>
>
> --
> 
> 
>
>



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: guilhermeblanco@hotmail.com
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil

---

## #37982 — Sebastian — 2008-05-28T19:45:32+00:00

URL: https://externals.io/message/37976#37982 · In reply to: #37979

Hi,

thank you, first of all because this was the first link to Zend Weekly News 
that worked. ;-)

then to the real thing: i already thougt that such an answer was abroad. i 
know that the zend engine has actually never been written to work with 
exceptions. altought the zend engine 2 has great new features its "just" an 
rewrite of version 1. alas, an exception is a direct break of code 
execution, so i actually cant understand the limitations. it should at least 
go to next years "summer of code" of google. would be interesting.

thanks.

Sebastian


""Guilherme Blanco"" <guilhermeblanco@gmail.com> schrieb im Newsbeitrag 
news:bcb7aa500805281226gdd63d2jd355cbc6da90856@mail.gmail.com...
> Hi Sebastian,
>
>
> This is known and I already asked this quite some time ago.
> Here is the summary of what have I asked here:
> http://devzone.zend.com/article/2016-Zend-Weekly-Summaries-Issue-336#Heading6
>
>
> Regards,
>
> On Wed, May 28, 2008 at 3:17 PM, Sebastian <admin@ifyouwantblood.de> 
> wrote:
> > […]
>
>
>
> -- 
> Guilherme Blanco - Web Developer
> CBC - Certified Bindows Consultant
> Cell Phone: +55 (16) 9166-6902
> MSN: guilhermeblanco@hotmail.com
> URL: http://blog.bisna.com
> Rio de Janeiro - RJ/Brazil
