时间:2021-07-01 10:21:17 帮助过:33人阅读
代码如下:
class foo {
private $a;
public $b = 1;
public $c;
private $d;
static $e;
public function test() {
var_dump(get_object_vars($this));
}
}
$test = new foo;
var_dump(get_object_vars($test));
$test->test();
?>
代码如下:
class foo {
private $a;
public $b = 1;
public $c='jb51.net';
private $d;
static $e;
public function test() {
var_dump(get_object_vars($this));
}
}
$test = new foo;
var_dump(get_object_vars($test));
$test->test();
?>
代码如下:
$a = array (1, 2, array ("a", "b", "c"));
var_dump ($a);
/* 输出:
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
array(3) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
}
}
*/
$b = 3.1;
$c = TRUE;
var_dump($b,$c);
/* 输出:
float(3.1)
bool(true)
*/
?>
以上就介绍了dumprep.exe PHP var_dump遍历对象属性的函数与应用代码,包括了dumprep.exe方面的内容,希望对PHP教程有兴趣的朋友有所帮助。