_prop['a'] = "String 1\n"; $this->_prop['b'] = "String 2\n"; } public function __get($name) { if($name == 'a') return $this->b; if($name == 'b') return $this->a; } } $obj = new test(); echo $obj->a; ?> ==== $ php test.php Notice: Undefined property: test::$a in test.php on line 18