Re: Referencing a "constant" class variable

From: Date: Thu, 07 Oct 2004 15:30:17 +0000
Subject: Re: Referencing a "constant" class variable
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-198840@lists.php.net to get a copy of this message
> A work around I've used in the past has been to use a keyed array such as: > $MyEnums = array( > "is" => "This", > "at" => "That", > "er" => "Other" > ); Only problem is that the above doesn't address my need (which I included in a subsequent post and probably should have included in my initial post). In order to use the above, I'd have to add it to the global scope and I'm not too keen on that. I tried using define(), but that doesn't seem to like defining arrays as constants. It would just have been very nice if PHP4 could have allowed access to a class' member variable w/o the need for instantiating the class. thnx, Chris

« previous php.general (#198840) next »