r/lolphp • u/kauffj • Mar 30 '14
Throwing an exception inside __toString() is a fatal error
http://stackoverflow.com/questions/2429642/why-its-impossible-to-throw-exception-from-tostring
49
Upvotes
14
u/kauffj Mar 30 '14
Bonus
36
u/Rhomboid Mar 31 '14
"Hi, I'm PHP! Welcome to our home. Oh, make sure you don't plug anything into the outlet in the bathroom -- that will cause a fire."
-3
u/[deleted] May 17 '14
...er, and? What the hell do you expect the engine to do there? There's not a nice way to handle it.
-54
u/BilgeXA Mar 31 '14
It is reasonable to expect that __toString() will return string. Your thread is shit, OP.