Solving problem with internal classes

This is my fix, first commit will introduce a test to reproduce the error, the second one will be the fix for it.

Related to #59
But if you restore the error-handler you've replaced, you may be overwriting an error-handler *deliberately* left dangling - as you say, we have no way of knowing.

I honestly don't think it matters much what you do - the error handler is global and gets overridden globally, so there really isn't any way to know what's right or wrong, it depends entirely on what some other programmer *intended*, but there's no way to reason about some other programmers intentions using code... since there's no way to do this "right", by nature of how error-handling works in php, I'd say do whatever makes you happy ;-)