19c05-1.php

来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 28 行

PHP
28
字号
<?php// Define a custom error handler for more detailsfunction detailed_err($errno, $errstr, $errfile, $errline, $errcontext) {	// First of all, begin by noting that a fatal error occurred, and basic	// details just like a normal error report:	echo "<p>FATAL ERROR - {$errstr}</p>\n";		// Now use debug_print_backtrace to give the function call list in	// a compressed format easy for quick scanning:	echo "<pre>\nFunction Call Tree:\n";	debug_print_backtrace();		// To finish off our 'extreme' debugging mode here, let's also give	// a full backtrace dump, which will contain all variables that existed	// and much much more.	echo "\nFull Backtrace:\n";	var_dump(debug_backtrace());		// Close off that pre tag	echo "</pre>\n";		// That's it, time to make sure the script dies:	die();}// Now go ahead and register this as the error handler:set_error_handler('detailed_err', E_ERROR | E_USER_ERROR);?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?