Throw your own - Nested exceptions
If you think that working with exceptions is hard to understand, exception nesting will look even harder (nested exceptions, chained exceptions, exception bubbling - it is all the same). Well, it is a step above, and it can be used if your application is structured in several layers, but at the end you'll see that it is a concept which is here to make your life easier. The basic syntax try { // do something that can go wrong } catch (Exception $e) { throw new Exception( 'Something really gone wrong', 0, $e); } Yes, you could see that kind of example at php.net, but it still does not make much sense. Why you caught it at first place, just to throw a new one? To be honest, it is a bad example (just like the examples on php.net). No wonder that you can not understand it. But lets stick on it for one more moment. First, you caught exception, like in any other try catch block, and than you passed it to an another one. It means that the second exception has reference to the ...