From 6a2012b4cf4b984d508f76f358bdf493b2b404e7 Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 11 May 2007 21:33:23 +0000 Subject: [PATCH] made dump accept second parameter as native function var_dump --- lib/Doctrine.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine.php b/lib/Doctrine.php index 6da3d3bd0..d570116ea 100644 --- a/lib/Doctrine.php +++ b/lib/Doctrine.php @@ -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); } /**