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