Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

var_dump(3) [php man page]

VAR_DUMP(3)								 1							       VAR_DUMP(3)

var_dump - Dumps information about a variable

SYNOPSIS
void var_dump (mixed $expression, [mixed $...]) DESCRIPTION
This function displays structured information about one or more expressions that includes its type and value. Arrays and objects are explored recursively with values indented to show structure. All public, private and protected properties of objects will be returned in the output unless the object implements a __debugInfo() method (implemented in PHP 5.6.0). Tip As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example). PARAMETERS
o $expression - The variable you want to dump. RETURN VALUES
No value is returned. EXAMPLES
Example #1 var_dump(3) example <?php $a = array(1, 2, array("a", "b", "c")); var_dump($a); ?> The above example will output: array(3) { [0]=> int(1) [1]=> int(2) [2]=> array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } } <?php $b = 3.1; $c = true; var_dump($b, $c); ?> The above example will output: float(3.1) bool(true) SEE ALSO
print_r(3), debug_zval_dump(3), var_export(3), __debugInfo(). PHP Documentation Group VAR_DUMP(3)

Check Out this Related Man Page

PRINT_R(3)								 1								PRINT_R(3)

print_r - Prints human-readable information about a variable

SYNOPSIS
mixed print_r (mixed $expression, [bool $return = false]) DESCRIPTION
print_r(3) displays information about a variable in a way that's readable by humans. print_r(3), var_dump(3) and var_export(3) will also show protected and private properties of objects with PHP 5. Static class members will not be shown. PARAMETERS
o $expression - The expression to be printed. o $return - If you would like to capture the output of print_r(3), use the $return parameter. When this parameter is set to TRUE, print_r(3) will return the information rather than print it. RETURN VALUES
If given a string, integer or float, the value itself will be printed. If given an array, values will be presented in a format that shows keys and elements. Similar notation is used for objects. When the $return parameter is TRUE, this function will return a string. Otherwise, the return value is TRUE. NOTES
Note When the $return parameter is used, this function uses internal output buffering so it cannot be used inside an ob_start(3) callback function. EXAMPLES
Example #1 print_r(3) example <pre> <?php $a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z')); print_r ($a); ?> </pre> The above example will output: <pre> Array ( [a] => apple [b] => banana [c] => Array ( [0] => x [1] => y [2] => z ) ) </pre> Example #2 $return parameter example <?php $b = array ('m' => 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); $results = print_r($b, true); // $results now contains output from print_r ?> SEE ALSO
ob_start(3), var_dump(3), var_export(3). PHP Documentation Group PRINT_R(3)
Man Page