note 73929 deleted from language.oop5 by danbrown
| From: | danbrown@php.net | Date: | Wed, 17 Jun 2009 18:49:45 +0000 |
| Subject: | note 73929 deleted from language.oop5 by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-157018@lists.php.net to get a copy of this message | ||
Note Submitter: openspecies
----
class enum {
private $__this = array();
function __construct()
{
$args = func_get_args();
$i = 0;
do{
$this->__this[$args[$i]] = $i;
} while(count($args) > ++$i);
}
public function __get($n){
return $this->__this[$n];
}
};
$days = new enum(
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
);
$today = $days->Thursday;
echo $today;