- var_dump: documentation ( source)
- print_r: documentation ( source)
<?php
$obj = new Obj;
$obj->oele['boele'][] = 'foo';
print_r($obj);
var_dump($obj->bar);
class Obj {
function __construct() {
$this->foo = 'bar';
}
function &__get($name) {
$this->$name = null;
$var = &$this->$name;
switch ( $name ) {
case 'bar':
$var = 'foo';
break;
}
return $this->$name;
}
}