Quite often I will try and run a PHP script and just get a blank screen back. 我常常会尝试运行PHP脚本,而后返回黑屏。 No error message; 没有错误信息; just an empty screen. 只是一个空白的屏幕。 The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a failed function call, or something else entirely. 缘由多是简单的语法错误(括号错误,分号丢失),函数调用失败或彻底是其余缘由。 函数
It is very difficult to figure out what went wrong. 弄清楚出了什么问题是很是困难的。 I end up commenting out code, entering "echo" statements everywhere, etc. trying to narrow down the problem. 我最终注释掉了代码,在各处输入“ echo”语句,等等,试图缩小问题的范围。 But there surely must be a better way, right? 可是确定有更好的方法吧? ui
Is there a way to get PHP to produce a useful error message, like Java does? 有没有办法像Java同样使PHP产生有用的错误消息? spa