Because of PHP\'s unlink()
not supporting exceptions natively, I\'m making a wrapper function for it. It should throw a FileNotFoundException
if, w
While reading trough my old questions I came across the ErrorException, combined with set_error_handler()
this would be a automatic Error to Exception transformer for all native PHP errors:
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
/* Trigger exception */
unlink('Does not exitsts');
Can anybody prof this?