Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just user print_r, along with a couple of wrapper functions to store the various DebugPrint I put in my code and one on the footer to dump the stack in the page (or in a file).</p> <p>I now try to use XDebug too... :-D</p> <p>OK, for the record, I give my little functions...</p> <pre><code>// Primitive debug message storage // $level = "Info", "Warn", "Error", "Title" function DebugPrint($toDump, $level = "Info") { global $debugMode, $debugDump, $debugCount; if ($debugMode != 'N') { $debugDump[$debugCount++] = "&lt;div class='Dbg$level'&gt;" . $toDump . "&lt;/div&gt;\n"; } } // Initialize debug information collection $debugMode = 'N'; // N=no, desactivated, P=dump to Web page, F=dump to file $debugSavePath = 'C:\www\App\log_debug.txt'; // If mode F $debugDump = array(); $debugCount = 0; // Primitive debug message dump function DebugDump() { global $debugMode, $debugSavePath, $debugDump, $debugCount; if ($debugMode == 'F') { $fp = fopen($debugSavePath, "a"); #open for writing } if ($debugCount &gt; 0) { switch ($debugMode) { case 'P': echo '&lt;div style="color: red; background: #8FC; font-size: 24px;"&gt;Debug:&lt;br /&gt; '; for ($i = 0; $i &lt; $debugCount; $i++) { echo $debugDump[$i]; } echo '&lt;/div&gt; '; break; case 'F': for ($i = 0; $i &lt; $debugCount; $i++) { fputs($fp, $debugDump[$i]); } break; //~ default: //~ echo "debugMode = $debugMode&lt;br /&gt;\n"; } } if ($fp != null) { fputs($fp, "-----\n"); fclose($fp); } } // Pre array dump function DebugArrayPrint($array) { global $debugMode; if ($debugMode != 'N') { return "&lt;pre class='ArrayPrint'&gt;" . print_r($array, true) . "&lt;/pre&gt;"; } else return ""; // Gain some microseconds... } </code></pre> <p>The interest is to delay the output to the end of the page, avoiding to clutter the real page.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload