function __get($property) { $method = "get{$property}"; // 1 if(method_exists($this->, $method)) { return $this->$method(); // 2 } }
Nie rozumiem o co chodzi i jak to działa (chodzi mi o 1 i 2)?
function __get($property) { $method = "get{$property}"; // 1 if(method_exists($this->, $method)) { return $this->$method(); // 2 } }
$method = 'get'.$property;