Manuel Pear

Gtk_VarDump

Provides a simple GUI to examine PHP variables, for example complex arrays or objects.

The GUI consists of two parts: a tree on the left side, displaying the values/objects/arrays that have subkeys/subvalues, and a list with scalar key-value pairs on the right side.

To use it, just include Gtk/VarDump.php and call the constructor with the variable to be dumped.

Exemple 45-7. Inspecting a variable with Gtk_VarDump

  1. <?php
  2. //some test class to dump
  3. class Test  
  4. { 
  5.    var $color = 'blue'; 
  6.    var $foo   = 'bar'; 
  7.    var $self = null; 
  8.    var $server = null; 
  9.  
  10.    function Test() 
  11.    { 
  12.       $this->self =& $this; 
  13.       $this->server =& $_SERVER; 
  14.    } 
  15.  
  16.    function doNothing() 
  17.    { 
  18.       //we're doing nothing here
  19.    }  
  20. }  
  21.  
  22. //include & display the variable
  23. require_once 'Gtk/VarDump.php';  
  24. new Gtk_VarDump(new Test());  
  25.  
  26. ?> 

Remonter Remonter
Jamma Play - L'éditeur javascript - CSS - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique