PHP类和错误消息 [英] PHP classes and error messaging
本文介绍了PHP类和错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对OOP和类很陌生。我苦苦挣扎的一件事是,如果类的方法中有错误,则不会显示任何错误消息,页面只会中断。有谁知道这是为什么,或者我怎么能显示错误?
I am quite new to OOP and classes. One thing I am struggling with is that if there are errors within a method of a class, no error messaging is displayed, the page just breaks. Does anyone know why this is or how I can get this to display errors?
推荐答案
http://us.php.net/manual/en/function.error-reporting.php
将此在包含您的课程的页面顶部。
Put this at the top of the page that includes your class.
<?php
error_reporting(E_ALL);
?>
这篇关于PHP类和错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文