src/Writer.php
public static function preVarDump($var, $die = false, $color = '#000000', $parsable = false, $output = true, $indirect = false)
    {
        // last line of defense ;)
        if(!defined('DEBUG') || DEBUG !== true) {
            return false;
        }

        $formated = '';

        // if ajax or cli, skip preformating
        $skipFormating =
            (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
            || php_sapi_name() == 'cli'
            || (defined('DEBUG_SKIP_FORMATTING') && DEBUG_SKIP_FORMATTING)
            || !$output;

        $skipFormating || $formated .= "<pre style='padding: 5px; background:#ffffff; font: normal 12px \"Lucida Console\", \"Courier\",
            monospace; position:relative; clear:both; color:{$color}; border:1px solid {$color}; text-align: left !important;'>";

        $formated .= self::_preFormat($var, $parsable, intval($indirect) + 1, $skipFormating);

        $skipFormating || $formated .= "</pre>";

        if(!$output) {
            return $formated;
        }

        echo $formated . "\n";

        if($die) {
            die("\n\nDebug terminated\n");
        }
    }
public static function preVarDump($var, $die = false, $color = '#000000', $parsable = false, $output = true, $indirect = false)
    {
        // last line of defense ;)
        if(!defined('DEBUG') || DEBUG !== true) {
            return false;
        }

        $formated = '';

        // if ajax or cli, skip preformating
        $skipFormating =
            (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
            || php_sapi_name() == 'cli'
            || (defined('DEBUG_SKIP_FORMATTING') && DEBUG_SKIP_FORMATTING)
            || !$output;

        $skipFormating || $formated .= "<pre style='padding: 5px; background:#ffffff; font: normal 12px \"Lucida Console\", \"Courier\",
            monospace; position:relative; clear:both; color:{$color}; border:1px solid {$color}; text-align: left !important;'>";

        $formated .= self::_preFormat($var, $parsable, intval($indirect) + 1, $skipFormating);

        $skipFormating || $formated .= "</pre>";

        if(!$output) {
            return $formated;
        }

        echo $formated . "\n";

        if($die) {
            die("\n\nDebug terminated\n");
        }
    }
public static function preVarDump ( $ var , $ die = false , $ color = '#000000' , $ parsable = false , $ output = true , $ indirect = false ) { // last line of defense ;) if ( ! defined ( 'DEBUG' ) || DEBUG !== true ) { return false ; } $ formated = '' ; // if ajax or cli, skip preformating $ skipFormating = ( isset ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] == 'XMLHttpRequest' ) || php_sapi_name ( ) == 'cli' || ( defined ( 'DEBUG_SKIP_FORMATTING' ) && DEBUG_SKIP_FORMATTING ) || ! $ output ; $ skipFormating || $ formated .= "<pre style='padding: 5px; background:#ffffff; font: normal 12px \"Lucida Console\", \"Courier\",
            monospace; position:relative; clear:both; color:{$color}; border:1px solid {$color}; text-align: left !important;'>" ; $ formated .= self :: _preFormat ( $ var , $ parsable , intval ( $ indirect ) + 1 , $ skipFormating ) ; $ skipFormating || $ formated .= "</pre>" ; if ( ! $ output ) { return $ formated ; } echo $ formated . "\n" ; if ( $ die ) { die ( "\n\nDebug terminated\n" ) ; } }
Dump debug variable

@author Dejan Samardzija <samardzija.dejan@gmail.com>
@param  mixed  $var      - variable
@param  bool   $die      - terminate script after dump
@param  string $color    - text color
@param  bool   $parsable - if true it uses var_export that dumps php usable value
@param  bool   $output   - if true it will echo formated string, for false it will return and override die part
@param  bool   $indirect - if call is direct or from wrapper function
@return void
Dump debug variable