lib/Cws/CwsDump.php
public function dump($var, $or = true)
    {
        $result = '';

        if ($var === null) {
            $result .= $this->dumpNull($or);
        } elseif (is_bool($var)) {
            $result .= $this->dumpBool($var, $or);
        } elseif (is_string($var)) {
            $result .= $this->dumpString($var, $or);
        } elseif (is_int($var)) {
            $result .= $this->dumpInt($var, $or);
        } elseif (is_float($var)) {
            $result .= $this->dumpFloat($var, $or);
        } elseif (is_array($var) || is_object($var)) {
            if ($this->recurseDepth >= $this->maxDepth) {
                $type = is_object($var) ? self::NAME_OBJECT : self::NAME_ARRAY;
                $maxDepthReached = $this->writeStart(false);
                $maxDepthReached .= $this->writeRow('<strong>'.$type.'</strong>');
                $maxDepthReached .= $this->writeRow('<span style="padding-left:10pt;font-style:italic;"><i>'
                    .self::DISPLAY_MAX_DEPTH.'</span>');
                $maxDepthReached .= $this->writeEnd();

                return $maxDepthReached;
            }
            $this->recurseDepth++;
            if (is_array($var)) {
                $result .= $this->dumpArray($var, $or);
            } else {
                $result .= $this->dumpObject($var, $or);
            }
            $this->recurseDepth--;
        } elseif (is_resource($var)) {
            $result .= $this->dumpRes($var, $or);
        } else {
            $result .= '???';
        }

        return $result;
    }
public function dump($var, $or = true)
    {
        $result = '';

        if ($var === null) {
            $result .= $this->dumpNull($or);
        } elseif (is_bool($var)) {
            $result .= $this->dumpBool($var, $or);
        } elseif (is_string($var)) {
            $result .= $this->dumpString($var, $or);
        } elseif (is_int($var)) {
            $result .= $this->dumpInt($var, $or);
        } elseif (is_float($var)) {
            $result .= $this->dumpFloat($var, $or);
        } elseif (is_array($var) || is_object($var)) {
            if ($this->recurseDepth >= $this->maxDepth) {
                $type = is_object($var) ? self::NAME_OBJECT : self::NAME_ARRAY;
                $maxDepthReached = $this->writeStart(false);
                $maxDepthReached .= $this->writeRow('<strong>'.$type.'</strong>');
                $maxDepthReached .= $this->writeRow('<span style="padding-left:10pt;font-style:italic;"><i>'
                    .self::DISPLAY_MAX_DEPTH.'</span>');
                $maxDepthReached .= $this->writeEnd();

                return $maxDepthReached;
            }
            $this->recurseDepth++;
            if (is_array($var)) {
                $result .= $this->dumpArray($var, $or);
            } else {
                $result .= $this->dumpObject($var, $or);
            }
            $this->recurseDepth--;
        } elseif (is_resource($var)) {
            $result .= $this->dumpRes($var, $or);
        } else {
            $result .= '???';
        }

        return $result;
    }
public function dump ( $ var , $ or = true ) { $ result = '' ; if ( $ var === null ) { $ result .= $ this -> dumpNull ( $ or ) ; } elseif ( is_bool ( $ var ) ) { $ result .= $ this -> dumpBool ( $ var , $ or ) ; } elseif ( is_string ( $ var ) ) { $ result .= $ this -> dumpString ( $ var , $ or ) ; } elseif ( is_int ( $ var ) ) { $ result .= $ this -> dumpInt ( $ var , $ or ) ; } elseif ( is_float ( $ var ) ) { $ result .= $ this -> dumpFloat ( $ var , $ or ) ; } elseif ( is_array ( $ var ) || is_object ( $ var ) ) { if ( $ this -> recurseDepth >= $ this -> maxDepth ) { $ type = is_object ( $ var ) ? self :: NAME_OBJECT : self :: NAME_ARRAY ; $ maxDepthReached = $ this -> writeStart ( false ) ; $ maxDepthReached .= $ this -> writeRow ( '<strong>' . $ type . '</strong>' ) ; $ maxDepthReached .= $ this -> writeRow ( '<span style="padding-left:10pt;font-style:italic;"><i>' . self :: DISPLAY_MAX_DEPTH . '</span>' ) ; $ maxDepthReached .= $ this -> writeEnd ( ) ; return $ maxDepthReached ; } $ this -> recurseDepth ++ ; if ( is_array ( $ var ) ) { $ result .= $ this -> dumpArray ( $ var , $ or ) ; } else { $ result .= $ this -> dumpObject ( $ var , $ or ) ; } $ this -> recurseDepth -- ; } elseif ( is_resource ( $ var ) ) { $ result .= $ this -> dumpRes ( $ var , $ or ) ; } else { $ result .= '???' ; } return $ result ; }
Dump variable into formatted XHTML string.

@param mixed $var
@param bool  $or

@return string - Formatted XHTML
Dump variable into formatted XHTML string .