Re: Allow __toString() to throw exceptions
| From: | Jakub Kubíček | Date: | Sat, 23 May 2015 21:25:48 +0000 |
| Subject: | Re: Allow __toString() to throw exceptions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86358@lists.php.net to get a copy of this message | ||
>
> Hi,
>
Hi Benjamin.
I have a question: is there any reason to throw an exception from
__toString, *other* than a non-recoverable error, which would denote that
the object, which the __toString method is called on, does not have any
meaningful string representation? Because if not, core implementation fully
serves its purpose throwing Fatal error now, even if it is non-standard way.
@aharvey said :
Should there ever be a Zend Engine 3, however, this could be revisited.
>
> ZE III is now here (AFAIK). So this have to be revisited :-*)*
Regards,
Kubo2