$wv->vardump($var)

Vardump is an alternative version of the function with the same PHP name used for debugging errors and displaying values. Originally created to display the debugging of the dbw class, started inside the main container as $wv->db, is an alias of the $wv->db->vardump() method.

This function uses, if available, the Javascript class "Prism" to display a layout with programming highlights. The Prism class can be obtained on this page:
http://prismjs.com/

This function is able to evaluate the different types of values that are evaluated as empty by empty, returning an "EMPTY:::" message followed by the type of variable, differentiating an empty string, a zero as string, a zero as integer, a zero as double, false, null, strings that only include invisible characters (space, tab and line break), empty arrays and empty objects. Arrays and multidimensional objects are also detected when they are empty, but in this case they show their structure, as they can be important for debugging.

When the variable, array or object contains data, it is displayed, with its structure in the case of arrays or objects.

This is an example of use with empty variables, arrays and objects:

$a = "0";
$b = 0;
$c = 0.0000000;
$d = " ";
$e = "";
$f = false;
$g = null;
$h = [];
$i = (object)[];
$j = [[[""," "]]];
$k = (object)[(object)[(object)[""," "]]];

$wv->vardump($a);
$wv->vardump($b);
$wv->vardump($c);
$wv->vardump($d);
$wv->vardump($e);
$wv->vardump($f);
$wv->vardump($g);
$wv->vardump($h);
$wv->vardump($i);
$wv->vardump($j);
$wv->vardump($k);

 

Resutados:

EMPTY::Var="0" (string)
EMPTY::Var=0 (integer)
EMPTY::Var=0.0 (double)
EMPTY::Var="" (string) - Blank chars detected!
EMPTY::Var="" (string)
EMPTY::Var=FALSE (boolean)
EMPTY::Var=NULL (or not set)
EMPTY::Array
EMPTY::Object
EMPTY::Array (Multidimensional)
SHOWING::Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [0] => 
                    [1] =>  
                )

        )

)
EMPTY::Object (Multidimensional)
SHOWING::stdClass Object
(
    [0] => stdClass Object
        (
            [0] => stdClass Object
                (
                    [0] => 
                    [1] =>  
                )

        )

)