<?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();
You have javascript disabled. You will not be able to edit any code.