Greetings,
I have an all purpose variable dumper that uses Var_Dump to show me
data structures.
I have an application wide function that I simply call to dump a
structure:
vardump($var);
function vardump ($vars, $details = null) {
if ($vars == 'dump') {
if (isset($GLOBALS['vardump']) ) {
Var_Dump::display($GLOBALS['vardump'],'GLOBALS',VAR_DUMP_DISPLAY_MODE_HTML_TABLE);
}
}
if ( isset($details) ) {
$GLOBALS['vardump'][$details][] = $vars;
} else {
$GLOBALS['vardump'][] = $vars;
}
}
The function can also accept a second argument that lets dumps
information about who/what/where the variable is being dumped from.
Now, sometimes I'm dumping alot so I would like to know where exactly
the dump came from, like this:
vardump($rows, basename(__FILE__) .' <br> '. __LINE__ );
Now, I'd like to keep the vardump() call as clean as possible. Is there
anyway for the function vardump to know the __FILE__ and __LINE__
without being told in an argument?
Many thanks!