- var_dump: documentation ( source)
<?php
class test {
protected $a = 'ciao';
public function salute()
{
$a = 'a';
echo $this->$a;
}
public function __get($name) {
var_dump($name);
return $this->$name;
}
}
$test = new test();
$test->salute();