- var_dump: documentation ( source)
<?php
class test {
private $prop = array();
public function &__get($name){
if(!array_key_exists($name, $this->prop)){
$this->prop[$name] = null;
}
return $this->prop[$name];
}
public function __set($name, $val){
$this->prop[$name] = $val;
}
}
$test = new test();
$test->a[] = 5;
var_dump($test);