//禁止错误输出 error_reporting(0); //设置错误处理器 set_error_handler('errorHandler'); register_shutdown_function('fatalErrorHandler'); class Test{ public function index(){ //这里发生一个警告错误,出发errorHandler echo $undefinedVarible; } } function errorHandler($errno,$errstr,$errfile,$errline){ $arr = array( '['.date('Y-m-d h-i-s').']', 'http://www.baidu.com', '|', $errstr, $errfile, 'line:'.$errline, ); // www.jbxue.com //写入错误日志 //格式 : 时间 uri | 错误消息 文件位置 第几行 error_log(implode(' ',$arr)."\r\n",3,'./test.txt','extra'); echo implode(' ',$arr)."\r\n"; } //捕获fatalError function fatalErrorHandler(){ $e = error_get_last(); switch($e['type']){ case E_ERROR: case E_PARSE: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_USER_ERROR: errorHandler($e['type'],$e['message'],$e['file'],$e['line']); break; } } $test = new Test(); ////这里发生一个警告错误,被errorHandler 捕获 $test->index(); //发生致命错误,脚本停止运行触发 fatalErrorHandler $test = new Tesdt(); $test->index();

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
