php错误接管
<?php set_error_handler("error_function",E_ALL); try{ echo 'ok'; echo $_POST['id']; }catch(Exception $e){ echo $e->getMessage(); } function error_function($errno, $errstr, $errfile, $errline) { echo "<b>Custom error:</b> [$errno] $errstr<br>"; echo " Error on line $errline in $errfile<br>"; }