1
0
mirror of synced 2024-12-13 22:56:04 +03:00

made dump accept second parameter as native function var_dump

This commit is contained in:
zYne 2007-05-11 21:33:23 +00:00
parent b8d1ab881b
commit 6a2012b4cf

View File

@ -485,9 +485,10 @@ final class Doctrine
* dumps a given variable
*
* @param mixed $var a variable of any type
* @param boolean $output whether to output the content
* @return void|string
*/
public static function dump($var)
public static function dump($var, $output = true)
{
$ret = array();
switch (gettype($var)) {
@ -504,6 +505,9 @@ final class Doctrine
default:
$ret[] = var_export($var, true);
}
if ($output) {
print implode("\n", $ret);
}
return implode("\n", $ret);
}
/**