I came up with a module of the PHP OOP handout on Handling Exceptions
, I practiced the exercises and such, but I'm still not quite sure when to use them, and why. I ran a search and found this:
and this
The S-question seemed to me to be more enlightening, as the php doc talks more about 'how to use' Exceptions. The answer that was accepted by @Tower is explanatory, but in the question it describes some code situations where he wanted to know whether or not to use the exceptions, but in the answer he does not use any of the codes used in the question. There is also the @rball response, and there it gives a different notion of exceptions. I would like to hear from you, when I should use them, and if possible, explain each situation proposed by the question quoted.
ps: I know there is an identical question, but the answer has been translated from the question I quoted up there ^, and as I said, the response that @Tower accepted does not describe the use of Exceptions in the codes it gave for example.
ps2 .: ELI5 (Explain Like I'm Five / Me explains as if I were a 5 year old)