PHP 自定义错误拦截
<?php function error_handler($errno, $errstr, $errfile, $errline, $errcontext) { //$errfile=str_replace(getcwd(),"",$errfile); //$errstr=str_replace(getcwd(),"",$errstr); switch ($errno) { case E_USER_ERROR: echo "<b>USER_ERROR</b> <br />"; echo "PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />"; exit(1); break; case E_USER_WARNING: echo "<b>USER_WARNING</b> <br />"; break; case E_USER_NOTICE: echo "<b>USER_NOTICE</b> <br />"; break; case E_NOTICE: echo "<b>NOTICE</b> <br />"; break; case E_WARNING: echo "<b>WARNING</b> <br />"; break; case E_RECOVERABLE_ERROR: echo "<b>RECOVERABLE_ERROR</b> <br />"; break; case E_ALL: echo "<b>ALL</b> <br />"; break; default: echo "<b>Unknown Error Type</b> <br />"; break; } echo "<b>Error level:</b> [$errno]<br /> "; echo "<b>Error message:</b> $errstr<br />"; echo "<b>Error line:</b> [$errline] <br />"; echo "<b>Error where:</b> $errfile<br />"; } set_error_handler('error_handler'); test(a); ?>
以上就是PHP 自定义错误拦截的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
