Home > Backend Development > PHP Tutorial > php var_dump simple test_PHP tutorial

php var_dump simple test_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:54:25
Original
912 people have browsed it

void var_dump ( mixed expression [, mixed expression [, ...]])


This function displays structural information about one or more expressions, including the expression's type and value. Arrays will expand values ​​recursively, showing their structure through indentation.

*/
function a_test($str) //Custom function
{
echo "nhi: $str"; //Output parameters
var_dump(debug_backtrace()); //Output backtrace
}
a_test('friend'); //Call user-defined function

//Let’s look at another var_dump traversal object instance

class foo {
private $a;
public $b = 1;
public $c='bKjia.c0m';
private $d;
static $e;
public function test() {
var_dump(get_object_vars($this));
}
}
$test = new foo;
var_dump(get_object_vars($test));
$test->test();

//Note: In order to prevent the program from outputting the results directly to the browser, you can use the output control function to capture the output of this function and save them to a variable of type string, for example.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632339.htmlTechArticlevoid var_dump ( mixed expression [, mixed expression [, ...]]) This function displays information about one or more Structural information of an expression, including the type and value of the expression. The array will recursively expand the values...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template