[ create a new paste ] login | about

Link: http://codepad.org/jwMaeVMN    [ raw code | fork ]

PHP, pasted on Nov 10:
<?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);
?>


Output:
No errors or program output.


Create a new paste based on this one


Comments: