Commit 6a2012b4 authored by zYne's avatar zYne

made dump accept second parameter as native function var_dump

parent b8d1ab88
...@@ -485,9 +485,10 @@ final class Doctrine ...@@ -485,9 +485,10 @@ final class Doctrine
* dumps a given variable * dumps a given variable
* *
* @param mixed $var a variable of any type * @param mixed $var a variable of any type
* @param boolean $output whether to output the content
* @return void|string * @return void|string
*/ */
public static function dump($var) public static function dump($var, $output = true)
{ {
$ret = array(); $ret = array();
switch (gettype($var)) { switch (gettype($var)) {
...@@ -504,6 +505,9 @@ final class Doctrine ...@@ -504,6 +505,9 @@ final class Doctrine
default: default:
$ret[] = var_export($var, true); $ret[] = var_export($var, true);
} }
if ($output) {
print implode("\n", $ret);
}
return implode("\n", $ret); return implode("\n", $ret);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment