PHP 3 除錯器協議以行為單位。每一行有一個型別(type),某幾行組成一個消息(message)。每一個消息起始於包含型別 start 的一行,並終止於包含型別 end 的一行。PHP 3 可以同時發送不同的消息行。
行的格式如下:
date 使用 ISO 8601 格式: (yyyy-mm-dd)
Time 精確到毫秒: hh:mm:uuuuuu
產生錯誤的 PHP 腳本所在主機的 DNS 名或 IP 位址。
產生錯誤的 PHP 腳本在 host 中的PID (進程 id)。
行的型別。它告訴接收訊息的程序如何處理下面的資料:
表格 D-1. 除錯器行型別
| 名稱 | 含義 |
|---|---|
| start | 告訴接收的程序,除錯訊息由此開始。data 的內容將會是錯誤消息的型別,在本頁面下方列出。 |
| message | PHP 3 錯誤消息。 |
| location | 發生錯誤的文件名和行號。location 的第一行總是包含頂級(top-level)位址。data 包含 file:line。在 message 和每一個 function 之後總有一行 location 行。 |
| frames | Number of frames in the following stack dump. If there are four frames, expect information about four levels of called functions. If no "frames" line is given, the depth should be assumed to be 0 (the error occurred at top-level).(TODO) |
| function | 發生錯誤的函式。在呼叫函式堆棧的每級只重複一次。 |
| end | 告訴接收的程序,除錯訊息到此結束。 |
每行的資料。
表格 D-2. 除錯器錯誤型別
| 除錯器 | PHP 3 內部 |
|---|---|
| warning | E_WARNING |
| error | E_ERROR |
| parse | E_PARSE |
| notice | E_NOTICE |
| core-error | E_CORE_ERROR |
| core-warning | E_CORE_WARNING |
| unknown | (其它任何錯誤) |