Using FirePHP instead of var_dump

541 Views Asked by At

When I output a variable using fb() function it only output the variable value, is there any way so it show also variable type like what var_dump does? Nor show name of variable, it any one shows that world would be more beauty!

2

There are 2 best solutions below

0
On

Try this:

FB::log(gettype($var).":$var");
0
On

You can wrap it easily enough.

function fb_dump() {
  ob_start();
  foreach(func_get_args() as $arg) {
    var_dump($arg);
  }
  $debug = ob_get_clean();
  fb($debug());
}

$foo = array(1, 5, 4);
$bar = "lorem ipsum";
fb_dump($foo, $bar);