In PHP, is there any way that I can ignore functions that are undefined instead of throwing a fatal error that is visible in the browser?—i.e., Fatal error: Call to
Prevent no. But catch and log yes, using register_shutdown_function()
See PHP manual
function shutDown_handler()
{
$last_error = error_get_last();
//verify if shutwown is caused by an error
if (isset ($last_error['type']) && $last_error['type'] == E_ERROR)
{
/*
my activity for log or messaging
you can use info:
$last_error['type'], $last_error['message'],
$last_error['file'], $last_error['line']
see about on the manual PHP at error_get_last()
*/
}
}
register_shutdown_function ('shutDown_handler');