Marin Kovacevic Marin Kovacevic - 11 days ago 4x
PHP Question

PHP: despite disabling all errors, copy() error message still displayed on page

I have:

ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);

It seems to work but when I use
function and try to copy to directory with denied access the error is displayed on the page itself. I don't need it. But I can't intercept
's errors. I tried
try...catch (Exception $e)
but still can't intercept it? How can I disable showing copy errors on page and how to intercept them in code?


from runtime it is better (and more reliable) to use:


see:, so-doc for more info.

also you can suppress any errors regarding of reporting level by prefixing expression with @:


see: for more info, also note what this cause a performance drop and causes expression to return boolean false if error occured, regardless of its original return type.