'php set_error_handler not working properly

I defined handler function in functions.php:

function errorHandler($errno, $errstr, $errfile, $errline) {
    echo "An error: $errstr";
    return true; // Preventing standard handler
}

Then I used it in set_error_handler:

require_once('functions.php');
set_error_handler("errorHandler");

But when I trigger notice, I get standard PHP message: Notice: Undefined variable: thisVariableDoesntExist in..., set_error_handler doesn't handle E_ERROR, but here I have notice, so I can't get it why this doesn't work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source