Handling Notice and Warning with try-catch in PHP

In PHP there is a big problem with catching errors, because Warnings and Notices are not Exceptions so you can’t catch them with try-catch syntax.
But in production code you will be needed such functionality.
So here is very simple implementation for handling Notice and Warning with try-catch in php:

Source