- var_dump: documentation ( source)
<?php
class A {
private $p1 = "secret";
public function B() {
var_dump($this);
${'t' . 'his'} = 'hidden'; // works
var_dump($this);
echo $this . ' ' . $this->p1;
var_dump($GLOBALS['this']);
$GLOBALS['this'] = 'lovely';
var_dump($this, $GLOBALS['this']);
echo $this . ' ' . $this->p1;
}
}
$a = new A;
$a->B();