<?php class Foo { protected $bar; public function __get($property) { return isset($this->$property) ? $this->$property : null; } } $foo = new Foo(); var_dump($foo->bar);
You have javascript disabled. You will not be able to edit any code.