function ErrorMsg($errno,$text,$file,$line)
{
if(error_reporting() == 0) return;
$file = explode("\\",$file);
$file = $file[count($file)-1];
echo "<div style='border:2px double black; padding: 10px; margin: 2px;'>
Код ошибки <strong>{$errno}</strong>!<br>
Файл: <tt>{$file}</tt>, строка <span style='color: red; font-weight: bold;'>{$line}</span>.<br>
Текст ошибки: <i>{$text}</i>
</div>";
}
set_error_handler("ErrorMsg",E_ALL);