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!
Asked
Active
Viewed 525 times
3

Handsome Nerd
- 17,114
- 22
- 95
- 173
-
Maybe [var_export()](http://php.net/manual/en/function.var-export.php) helps? I don't know what you missing in `var_dump()` – Ron van der Heijden Jan 21 '13 at 13:33
-
@Bondye I missed the same thing that FirePHP developer missed `;)` – Handsome Nerd Jan 21 '13 at 13:35
-
Never worked with FirePHP but doesn't just `FB::log(var_dump('Log message'));` works? – Ron van der Heijden Jan 21 '13 at 13:41
-
anyone reading this may also be interested in [this](http://stackoverflow.com/questions/14995307/sending-var-dump-to-firebug-console) – Walter Tross Mar 12 '13 at 14:21
2 Answers
0
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);

Sam Dufel
- 17,560
- 3
- 48
- 51