- var_dump: documentation ( source)
<?php
class A {
public function __construct() {
$this->func = function() {
return array(
'a' => 1,
'b' => 10,
);
};
}
public function __get($k) {
$func = $this->func;
return $func();
}
}
$a = new A;
var_dump($a->test['a']);