I'm using PHP version 5.3.19 and I have the following code :
set_exception_handler(array($this->main_model,'nothing'));
set_error_handler(array($this->main_model,'nothing'));
error_reporting(0);
foreach ($data as $row){
...
}
restore_error_handler();
Now i just tried hacking with the nothing
there, it's a function doing nothing because i tried setting them as null but that didn't changed, and this doesn't change it too.
I've also tried wrapping in try catch
but it stills handles the error.
I can't disable the errors completly as im using them with a custom error handler, what i want is to disable the foreach
loop for errors, i've also called the function with @
but since i used custom error handler it no longer worked.
I've read here that when using custom handler php ignores error_reporting
.
How can i get the foreach to not handle errors no matter what?