summaryrefslogtreecommitdiff
path: root/it_debug.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_debug.class')
-rw-r--r--it_debug.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it_debug.class b/it_debug.class
index 6cad9b5..8284093 100644
--- a/it_debug.class
+++ b/it_debug.class
@@ -120,6 +120,7 @@ static function setup()
* @param $p['color'] Allow color [true]
* @param $p['html'] Allow html [default based on REMOTE_ADDR]
* @param $p['short'] Omit variable names
+ * @param $p['print_r'] Use print_r instead of var_export (no escaping for strings)
* @return String representation of dump
*/
static function dump($args, $p = [])
@@ -170,7 +171,7 @@ static function dump($args, $p = [])
foreach ($args as $arg)
{
$var = array_shift($argnames);
- $item = gettype($arg) == 'resource' || is_array($arg) && isset($arg['GLOBALS']) || is_object($arg) && is_a($arg, "SimpleXMLElement") ? trim(print_r($arg, true)) : trim(var_export($arg, true));
+ $item = gettype($arg) == 'resource' || is_array($arg) && isset($arg['GLOBALS']) || is_object($arg) && is_a($arg, "SimpleXMLElement") || $p['print_r'] ? trim(print_r($arg, true)) : trim(var_export($arg, true));
# Replace PHP 5+ var_export object representation by old readable style
while (preg_match("#(.*\b)(\w+)::__set_state\(array\(([^()]+)\)\)(.*)#s", $item, $regs) && ++$iterations < 100)