I\'m trying to do the following:
try { // just an example $time = \'wrong datatype\'; $timestamp = date(\"Y-m-d H:i:s\", $time); } catch (Ex
The shorter that I have found:
set_error_handler(function($errno, $errstr, $errfile, $errline ){ throw new ErrorException($errstr, $errno, 0, $errfile, $errline); });
Makes all errors becoming instance of catchable ErrorException
ErrorException