Keys →
Functions ↓
function dump ( $a='', $r=2, $prt=true ) {#-k debug print trace#-d 4/7/12 - returns output str#- only use dump if it's an array or you're dumping global values#- $prt: true, also pass-thru to prt#- false, return output as a string#- $r: 0: pass-thru command to prt#- 1:#- 2: (default) global $logfcb; $ar = callingVars ( 1 ); $nm = $ar[0]['name']; $typ = is($a);if (strlen($nm) && !strpos(' '.$typ,'array')) { # something, but not an array if (strpos(' '.$typ,'null')) { $out = 'Non-existant array (' . $nm . ')'; } else { $out = 'wrong type (' . $nm . ' is ' . $typ . '); dump -> prt' . "<br>\n" . $a; } if ($prt) prt ( $out, $r ); return $out; } if (!strlen($nm)) { # dump all variables $nm .= ' -> ' . '$GLOBALS '; if (isset($logfcb['log']['f'])) { $defs = get_defined_constants(true); $defs = $defs['user']; $out = $nm . print_r($GLOBALS, true) . "\n ========== Defined variables ========== \n" . print_r(get_defined_vars(), true) . "\n ======= User-defined constants ======== \n" . print_r($defs, true) . "\n " . dumpFunctions(); } else { $out = '<br><hr><b>' . $nm . '</b><br><br>' . stackPlace() . '<pre>' . print_r($GLOBALS, true) . '<br><hr><br> ========== Defined variables ========== ' . print_r(get_defined_vars(), true) . '<br><hr><br> ======= User-defined constants ======== ' . print_r($defs, true) . '</pre><br>' . dumpFunctions(); } } else { # dump an array if (isset($logfcb['log']['f'])) { $out = 'Dump: ' . $nm . "\n" . print_r($a,true); } else { $out = '<b>' . callingPath() . $nm . '</b><br><br>' . '<pre>' . "\n" . print_r($a,true) . '</pre><br>'; } } if ($prt) prt ( $out, $r ); return $out; }?>