note 65365 deleted from language.oop5.overloading by bjori
| From: | bjori@php.net | Date: | Sat, 27 May 2006 15:21:28 +0000 |
| Subject: | note 65365 deleted from language.oop5.overloading by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-112361@lists.php.net to get a copy of this message | ||
Note Submitter: Lucas Bares mail at luke-b dot com
----
I thought i had to use a class like Setter (see top) but that still works:
<?php
class dynamic_class_vars{
public function __construct(){
}
public function __get($var){
return $this->{$var};
}
public function __set($var,$value){
$this->{$var} = $value;
}
}
$object = new dynamic_class_vars();
$object->a = 'Hello';
$object->b = 'World';
echo $object->a.' '.$object->b;
?>
I wondered that it works. But this would Functions effects a lot of new possibilities fpr
developers.