Versions
Look up a class, method, property or event

CVarDumper

Package system.utils
Inheritance class CVarDumper
Since 1.0
Version $Id: CVarDumper.php 1761 2010-01-28 14:16:37Z qiang.xue $
CVarDumper is intended to replace the buggy PHP function var_dump and print_r. It can correctly identify the recursively referenced objects in a complex object structure. It also has a recursive depth control to avoid indefinite recursive display of some peculiar variables.

CVarDumper can be used as follows,
CVarDumper::dump($var);

Public Methods

Hide inherited methods

MethodDescriptionDefined By
dump() Displays a variable. CVarDumper
dumpAsString() Dumps a variable in terms of a string. CVarDumper

Method Details

dump() method
public static void dump(mixed $var, integer $depth=10, boolean $highlight=false)
$var mixed variable to be dumped
$depth integer maximum depth that the dumper should go into the variable. Defaults to 10.
$highlight boolean whether the result should be syntax-highlighted

Displays a variable. This method achieves the similar functionality as var_dump and print_r but is more robust when handling complex objects such as Yii controllers.

dumpAsString() method
public static string dumpAsString(mixed $var, integer $depth=10, boolean $highlight=false)
$var mixed variable to be dumped
$depth integer maximum depth that the dumper should go into the variable. Defaults to 10.
$highlight boolean whether the result should be syntax-highlighted
{return} string the string representation of the variable

Dumps a variable in terms of a string. This method achieves the similar functionality as var_dump and print_r but is more robust when handling complex objects such as Yii controllers.

Be the first person to leave a comment

Please to leave your comment.