Does not set_error_handler ovveride the error_reporting seetting in php.ini?
I mean if E_NOTICE is of in php.ini set_error_handler should not show E_NOTICE too?
I tried this:
$logger = new Zend\Log\Logger;
$writer = new Zend\Log\Writer\Stream(‘php://output’);
$logger->addWriter($writer);
Zend\Log\Logger::registerErrorHandler($logger);
Then added below, but I did not get any notice message because of undefined array element. as it seems errorHandler is registered.
if($blah[aa]) {
print(“a”);
}
why I am not getting any notice log for this? (E_NOTICE is off in my php.ini but I expected set_error_handler turns it on) I tried adding in start error_reporting(-1) and I see both zend/log notice and also normal php notice, so how can I use the error handler of zend/log without using error_reporting(-1), because if I use it, I see the normal php errors too as well as the one by zend/log?
I did this trick:
error_reporting(E_ALL);
ini_set(‘display_errors’, ‘0’);
But I am not sure if this is really necessary when using zend/log errorhandler?
Am I in correct way adding these two lines to solve the issue? I am still wondering why zend/login set_error_handler did not turn on E_NOTICE?