php抛出错误的方法:首先调试php报错;然后通过“set_error_handler('socketErrorLog');”方式抛出php错误即可。
php入门到就业线上直播课:进入学习
Apipost = Postman + Swagger + Mock + Jmeter 超好用的API调试工具:点击使用
推荐:《PHP视频教程》
php 抛出错误的 调试方法
//调试 php报错function socketErrorLog($errno, $errstr, $errfile, $errline){$log = '[' . date('m d H:i:s') . '] errno:' . $errno . " errfile:$errfile line:$errline\n";$log .= "error: " . $errstr;$log .= "\n========================================================\n";file_put_contents(dirname(__FILE__).'/chaoyu.log', $log, FILE_APPEND);}//抛出php错误set_error_handler('socketErrorLog');
登录后复制
以上就是php如何抛出错误的详细内容,更多请关注php中文网其它相关文章!