<?php
class UserInfo{
private $username;
private $privileges;
public function __get($property) {
if (property_exists($this, $property)) {
return $this->$property;
}
}
public function __set($property, $value) {
if (property_exists($this, $property)) {
$this->$property = $value;
}
return $this;
}
}
$user=new UserInfo;
$user->__set($username,"someuser");
echo $user->__get($username);
?>