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 modifying persistent structures such as
databases.
Not explicitly handling exceptions from __toString() will not cause
segfaults or memory corruption if you don't do anything. It only means that
your function call will not abort at the earliest possible opportunity. If
you have functions modifying persistent datastores it's a good idea to
review them to make sure you handle exceptions right away, but otherwise I
wouldn't be overly concerned.
Thanks Nikita that's much clearer to me now.
I'm not as concerned as this is much different from "bad things will
happen" ;)
Cheers
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php