Someone
public text v1 · immutable<?php
class test
{
private $_prop;
public function __construct()
{
$this->_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