Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class test {
- private $options = array(
- 'var1' => '1',
- 'var2' => '2',
- );
- public function __set($name, $value) {
- $this->options[$name] = $value;
- }
- public function __get($name) {
- if ($this->options[$name]) {
- return $this->options[$name];
- }
- }
- }
- $test = new test;
- $test->var1 = 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement