im not quite understanding the documentation on the get()
class WEE
{
private $id;
public function __get($name)
{ return (isset($this->$name) ? $this->$name : NULL); }
}
$woo = new WEE;
the documentation makes it look like i should be able to access the variable $id simply by doing $woo->id is that correct? when i try that i get
Fatal Error: Cannot access private property WEE::$id
however, if i do $woo->__get("id") it works fine.
which is the proper way to call __get()?