I need to catch some warnings being thrown from some php native functions and then handle them.
Specifically:
array dns_get_record ( string $hostnam
The solution that really works turned out to be setting simple error handler with E_WARNING parameter, like so:
E_WARNING
set_error_handler("warning_handler", E_WARNING); dns_get_record(...) restore_error_handler(); function warning_handler($errno, $errstr) { // do something }