Prado\Util\TVarDumper::dump PHP Метод

dump() публичный статический Метод

This method achieves the similar functionality as var_dump and print_r but is more robust when handling complex objects such as PRADO controls.
public static dump ( $var, $depth = 10, $highlight = false ) : string
Результат string the string representation of the variable
    public static function dump($var, $depth = 10, $highlight = false)
    {
        self::$_output = '';
        self::$_objects = array();
        self::$_depth = $depth;
        self::dumpInternal($var, 0);
        if ($highlight) {
            $result = highlight_string("<?php\n" . self::$_output, true);
            return preg_replace('/&lt;\\?php<br \\/>/', '', $result, 1);
        } else {
            return self::$_output;
        }
    }

Usage Example

Пример #1
0
 /**
  * Converts a variable into a string representation.
  * This method achieves the similar functionality as var_dump and print_r
  * but is more robust when handling complex objects such as PRADO controls.
  * @param mixed variable to be dumped
  * @param integer maximum depth that the dumper should go into the variable. Defaults to 10.
  * @param boolean whether to syntax highlight the output. Defaults to false.
  * @return string the string representation of the variable
  */
 public static function varDump($var, $depth = 10, $highlight = false)
 {
     return TVarDumper::dump($var, $depth, $highlight);
 }