3

trace

trace
SYNOPSIS

trace()

DESCRIPTION
CODE
  1. require_once 'dump.php';
  2.  
  3. function trace() {
  4.     static $trace = null;
  5.  
  6.     if (func_num_args() == 0) {
  7.         return $trace;
  8.     }
  9.  
  10.     $var = func_get_arg(0);
  11.     $label = func_num_args() > 1 ? func_get_arg(1) : null;
  12.  
  13.     if (!$trace) {
  14.         $trace = array();
  15.     }
  16.  
  17.     $trace[]=dump($var, $label, false);
  18.  
  19.     return true;
  20. }

Comments

To add a comment, click here.