As others have pointed out we can use register_shutdown_function() and error_get_last() in following fashion.
The below implementation will catch the errors which are not even caught by \Throwable
as tested in php 7.1. It should work for previous PHP versions too. It should only be implemented in your development environment(by just adding it in your development config file) and shouldn't be done in production environment.
Implementation
register_shutdown_function(function () {
$err = error_get_last();
if (! is_null($err)) {
print 'Error#'.$err['message'].'<br>';
print 'Line#'.$err['line'].'<br>';
print 'File#'.$err['file'].'<br>';
}
});
Example Error
Error# Class Path/To/MyService contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Path/To/MyServiceInterface::add)
Line# 12
File# Path/To/MyService.php