var_dump it!

@param type $var
@param type $continue
@param type $hide
@param type $return
@return type
422172
public static function dump($var, $continue = false, $hide = false, $return = false)
    {
        return self::it($var, AbstractDumper::VAR_DUMP, $continue, $hide, $return);
    }
1199704
public static function backtrace($returnVal = false, $ignoreAjax = false, $ignoredFunctions = null)
    {
        $plainText = Director::is_cli() || (Director::is_ajax() && !$ignoreAjax);
        $result = self::get_rendered_backtrace(debug_backtrace(), $plainText, $ignoredFunctions);
        if ($returnVal) {
            return $result;
        } else {
            echo $result;
            return null;
        }
    }
927983
public static function var_dump() {
        global $USER, $CONTEXT, $LINK, $RESULT;
        echo('$USER:'."\n");
        if ( ! isset($USER) ) {
            echo("Not set\n");
        } else {
            var_dump($USER);
        }
        echo('$CONTEXT:'."\n");
        if ( ! isset($CONTEXT) ) {
            echo("Not set\n");
        } else {
            var_dump($CONTEXT);
        }
        echo('$LINK:'."\n");
        if ( ! isset($LINK) ) {
            echo("Not set\n");
        } else {
            var_dump($LINK);
        }
        echo('$RESULT:'."\n");
        if ( ! isset($RESULT) ) {
            echo("Not set\n");
        } else {
            var_dump($RESULT);
        }
        echo("\n<hr/>\n");
    }
614574
public static function dump($data, $return = false)
    {
        $result = '';

        if (Fabrication::isCli()) {
            $end = "\n";
        } else {
            $end = "<br />\n";
        }

        if (is_object($data)) {

            $classname = get_class($data);

            $result = str_repeat('-', 80) . $end .
                    "\t" . __METHOD__ . ' Type: ' . gettype($data) . "\tReturn:" . var_export($return, true) . $end .
                    str_repeat('-', 80) . $end .
                    "Object Instance: $classname: $end" .
                    "Object Methods $end";

            $class_methods = get_class_methods($data);
            if (count($class_methods) > 0) {
                foreach ($class_methods as $method) {
                    $result.="\t" . $method . $end;
                }
            } else {
                $result.="No methods found.$end";
            }

            $result.= $end;
            $result.= "Object XPath:$end";
            $result.= $end;

            switch ($classname) {

                case 'DOMAttr':
                    $result.= "DOMAttr XPath: {$data->getNodePath()}$end" .
                            $data->ownerDocument->saveXML($data);
                    break;

                case 'DOMDocument':
                    $result.= "DOMDocument XPath: {$data->getNodePath()}$end" .
                            $data->saveXML($data);
                    break;

                case 'DOMElement':
                    $result.= "DOMElement XPath: {$data->getNodePath()}$end" .
                            $data->ownerDocument->saveXML($data);
                    break;

                case 'DOMNodeList':
                    for ($i = 0; $i < $data->length; $i++) {
                        $result.= "DOMNodeList Item #$i, " .
                                "XPath: {$data->item($i)->getNodePath()}$end" .
                                "{$data->item($i)->ownerDocument->saveXML($data->item($i))}$end";
                    }
                    break;

                default: $result.= var_export($data, true);
            }
        }

        if (is_array($data)) {

            $result = $end .
                $end .
                str_repeat('-', 80) . $end .
                "| DUMP Type:" . gettype($data) . "\tReturn:" . var_export($return, true) . $end .
                str_repeat('-', 80) . $end .
                $end;
        }

        if (is_string($data)) {
            $result = var_export($data, true);
        }

        if (is_int($data)) {
            $result = var_export($data, true);
        }

        if ($return) {
            return $result . $end;
        } else {
            echo $result . $end;
        }
    }
7856
protected function _dump_php(&$var) {
		$scope = false;
		$prefix = 'unique';
		$suffix = 'value';

		if ($scope) $vals = $scope;
		else $vals = $GLOBALS;

		$old = $var;
		$var = $new = $prefix.rand().$suffix; $vname = false;
		foreach ($vals as $key => $val) {
			if ($val === $new) $vname = $key;
		}
		$var = $old;

		$output = '<div class="args">';
		$output .= $this->_dump_php_recursive($var, '$'.$vname);
		$output .= "</div>";
		
		return $output;
	}
527409
protected function evalVarDump($variable)
    {
        $dumper = new HtmlDumper;
        $cloner = new VarCloner;

        $output = '<div style="display:none">';
        $output .= $dumper->dump($cloner->cloneVar($variable), true);
        $output .= '</div>';

        return $output;
    }
600498
public static function dump($var, $to=null)
	{
		$console = self::getInstance();
		$console->addVar($var);

		echo $console->render($to);
		$console->clear();
	}
1340161
static function dump($var, $trace = true)
    {
        $d = Debug::getInstance();

        if ($d->level < 1) {
            return;
        }

        if ($d->terminal) {
            $c = $d->console;

            if (!is_array($var)) {
                $c->writeln(print_r($var, 1), 'blue');
            } else {
                $lines = explode("\n", print_r($var, 1));
                foreach ($lines as $line) {
                    preg_match_all('|(.*)\[(.*)\] \=\>(.*)|', $line, $m);
                    
                    if (!isset($m[0][0])) {
                        $c->writeln($line);
                    } else {
                        $c->write($m[1][0] . '[', 'blue');
                        $c->write($m[2][0], 'light_red');
                        $c->write('] =>', 'blue');
                        $c->writeln($m[3][0], 'blue');
                    }
                }
            }

        } else {
            $txt = preg_replace('/\[(.*)\]/u', '[<span style="color:#d00">$1</span>]', print_r($var, 1));
            echo '<pre style="color:blue">' . $txt . "</pre>";
        }

        if ($trace)
            $d->_trace();
    }
1278223
public function &push($var) {
    if (is_object($var) && in_array('Iterator', class_implements($var))) {
      return $this->append($var);
    }
    else {
      return $this->append(new \ArrayIterator(func_get_args()));
    }
  }
259773
static function dumpVariable( $var )
    {
        // If we have var_export (PHP >= 4.2.0) we use the instead
        // provides better output, doesn't require output buffering
        // and doesn't get mangled by Xdebug

        // dl: we should always use 'var_dump' since 'var_export' is
        // unable to handle recursion properly.
        //if ( function_exists( 'var_export' ) )
        //    return var_export( $var, true );

        ob_start();
        var_dump( $var );
        $variableContents = '';
        if ( extension_loaded( 'xdebug' ) )
           $variableContents = self::XDEBUG_SIGNATURE;
        $variableContents .= ob_get_contents();
        ob_end_clean();
        return $variableContents;
    }
52120
function dump($return = false, $print = true, $depth = 1)
    {
        $dump = array();
        $dump['count'] = $this->count;
        $dump['results'] = array();
        foreach ((array)$this->records() as $key => $record) {
            if ($record instanceof Resource) {
                $dump['results'][$key] = $record->data();
                foreach ($record->links as $field => $link) {
                    if ($depth < 1) {
                        try {
                            $link_record = $record[$field];
                        } catch (ServerException $e) {
                            $link_record = array('$error' => $e->getMessage());
                        }

                        if ($link_record instanceof Resource) {
                            $dump['results'][$key][$field] = $link_record->dump(true, false, $depth+1);
                        } else {
                            $dump['results'][$key][$field] = $link_record;
                        }
                    }
                }
            }
        }
        if ($dump['results'] && $links = $this->links) {
            $dump['$links'] = $this->dump_links($links);
        }
        if ($dump['count'] > 0) {
            $dump['page'] = $this->page;
        }
        if ($this->pages) {
            $dump['pages'] = $this->pages;
        }
        
        if ($print) {
            return print_r($dump, $return);
        } else {
            return $dump;
        }
    }
324433
private static function fillReturnWithClassAttributes($var, stdClass $return, int $maxDepth)
    {
        $clone = (array) $var;

        foreach (array_keys($clone) as $key) {
            $aux  = explode("\0", $key);
            $name = end($aux);
            if ($aux[0] === '') {
                $name .= ':' . ($aux[1] === '*' ? 'protected' : $aux[1] . ':private');
            }
            $return->$name = self::export($clone[$key], $maxDepth - 1);
        }

        return $return;
    }
1072435
public static function dump($var, $echo = true)
    {
        ob_start();
        var_dump($var);

        $output = ob_get_clean();
        $output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);

        if (PHP_SAPI == "cli") {
            $output = PHP_EOL . PHP_EOL . $output . PHP_EOL;
        } else {
            $output = "<pre>" . htmlspecialchars($output, ENT_QUOTES) . "</pre>";
        }

        if ($echo) echo($output);

        return $output;
    }
1295090
function append($tpl_var, $value=null, $merge=false)
	{
		if (is_array($tpl_var)) {
			// $tpl_var is an array, ignore $value
			foreach ($tpl_var as $_key => $_val) {
				if ($_key != '') {
					if(!@is_array($this->_tpl_vars[$_key])) {
						settype($this->_tpl_vars[$_key],'array');
					}
					if($merge && is_array($_val)) {
						foreach($_val as $_mkey => $_mval) {
							$this->_tpl_vars[$_key][$_mkey] = $_mval;
						}
					} else {
						$this->_tpl_vars[$_key][] = $_val;
					}
				}
			}
		} else {
			if ($tpl_var != '' && isset($value)) {
				if(!@is_array($this->_tpl_vars[$tpl_var])) {
					settype($this->_tpl_vars[$tpl_var],'array');
				}
				if($merge && is_array($value)) {
					foreach($value as $_mkey => $_mval) {
						$this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
					}
				} else {
					$this->_tpl_vars[$tpl_var][] = $value;
				}
			}
		}
	}
133401
public static function print_finish_info($returnurl, $continueurl, $extras=null) {
        if ($returnurl) {
            echo '<a href="' . $returnurl . '">' . get_string('returntowhereyouwere', 'portfolio') . '</a><br />';
        }
        if ($continueurl) {
            echo '<a href="' . $continueurl . '">' . get_string('continuetoportfolio', 'portfolio') . '</a><br />';
        }
        if (is_array($extras)) {
            foreach ($extras as $link => $string) {
                echo '<a href="' . $link . '">' . $string . '</a><br />';
            }
        }
    }
960139
public static function print_r($var, $varname = '...', $params = array())
    {
        if (!self::isDebug()) {
            return false;
        }

        $output = print_r($var, true);

        $_this = self::i();
        $_this->_dumpRenderHtml($output, $varname, $params);

        return $_this;
    }
121940
public static function dump($var, int $maxDepth = 2) : string
    {
        $html = ini_get('html_errors');

        if ($html !== true) {
            ini_set('html_errors', true);
        }

        if (extension_loaded('xdebug')) {
            ini_set('xdebug.var_display_max_depth', $maxDepth);
        }

        $var = self::export($var, $maxDepth);

        ob_start();
        var_dump($var);

        try {
            $output = ob_get_clean();
            assert(is_string($output));

            return strip_tags(html_entity_decode($output));
        } finally {
            ini_set('html_errors', $html);
        }
    }