As I understand, when you define __get and __set functions in php, the way of reaching attributes don’t change. I mean
class something {
public $world;
public $hello;
public function __get($name) {
return $this - > $name;
}
public function _set($name, $value) {
$this - > $name = $value;
}
}
Now I am wondering what I am gonna do if I don’t want $hello to call __get and __set functions implicitly when I reach it, only for $world;
What I want is would look like this one in C#
class something {
public string world;
public string hello{get;set;}
}
Thanks…
Any unaccessible properties will automatically call
__getand__set, therefore, set$worldtoprivate.