- var_dump: documentation ( source)
- error_reporting: documentation ( source)
<?php
class Test {
private $x = 42;
function __get($name) {
$test = new Test2($this);
return $test->$name;}
}
class Test2 {
function __construct($arg) {
$this->arg = $arg;
}
function __get($name) {
return $this->arg->$name;
}
}
error_reporting(E_ALL|E_NOTICE| E_STRICT);
$test = new Test;
var_dump($test->x);