PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
# somewhere at the very top of the script
set_error_handler(create_function(
'$severity, $message, $filename, $lineno',
'{throw new ErrorException($message, 0, $severity, $filename, $lineno);}'
));
and wrap the "dangerous" pieces into try-catch blocks:
Try to avoid using @: rather, create a blank function and set it as the error handler. The reason for this more verbose syntax is that if a custom error handler implementation doesn't honor error_reporting(), the errors won't get suppressed.