Skip to content
PHP Ecosystem
Explore

VarDumper

API reference › yii › helpers › VarDumper

classyii\helpers\VarDumper
ExtendsBaseVarDumper
Since2.0
Sourceframework/helpers/VarDumper.php

VarDumper 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.

VarDumper can be used as follows,

VarDumper::dump($var);
MethodDescriptionDefined by
dump() staticDisplays a variable.BaseVarDumper
dumpAsString() staticDumps a variable in terms of a string.BaseVarDumper
export() staticExports a variable as a string representation.BaseVarDumper