Re: [PHP] Referencing a constant class variable

2004-10-07 Thread Chris Boget
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

[PHP] Referencing a constant class variable

2004-10-06 Thread Chris Boget
If I have a class that looks like this: class MyClass { var $MyClassVar = Bob; } is there a way to reference that variable w/o instantiating MyClass? I've tried: MyClass::$MyClassVar MyClass-$MyClassVar MyClass.$MyClassVar nothing works. Is this even possible? I'm using PHP 4.3.2. thnx,

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread Greg Donald
On Wed, 6 Oct 2004 11:08:22 -0500, Chris Boget [EMAIL PROTECTED] wrote: If I have a class that looks like this: class MyClass { var $MyClassVar = Bob; } is there a way to reference that variable w/o instantiating MyClass? I've tried: MyClass::MyClassVar -- Greg Donald Zend

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread Greg Donald
On Wed, 6 Oct 2004 13:02:18 -0500, Greg Donald [EMAIL PROTECTED] wrote: On Wed, 6 Oct 2004 11:08:22 -0500, Chris Boget [EMAIL PROTECTED] wrote: If I have a class that looks like this: class MyClass { var $MyClassVar = Bob; } is there a way to reference that variable w/o

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread Daniel Schierbeck
Greg Donald wrote: On Wed, 6 Oct 2004 13:02:18 -0500, Greg Donald [EMAIL PROTECTED] wrote: On Wed, 6 Oct 2004 11:08:22 -0500, Chris Boget [EMAIL PROTECTED] wrote: If I have a class that looks like this: class MyClass { var $MyClassVar = Bob; } is there a way to reference that variable w/o

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread Chris Boget
I believe you can make the property static (at least in PHP5): class MyClass { public static $myClassVar = Bob; } echo MyClass::$myClassVar; // Bob Unfortunately, in PHP4.3.2 that doesn't seem to be working... :( Does anyone know how I can access a class' variable w/o having to instantiate

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread M. Sokolewicz
Chris Boget wrote: I believe you can make the property static (at least in PHP5): class MyClass { public static $myClassVar = Bob; } echo MyClass::$myClassVar; // Bob Unfortunately, in PHP4.3.2 that doesn't seem to be working... :( Does anyone know how I can access a class' variable w/o having to

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread Chris Boget
reference like MyClass::MyVar. Don't use PHP5 conventions in PHP4! I'm curious if you tested your code? Did it work? If so, what version of PHP are you using? I copied and pasted the code you provided and got the following error: Parse error: parse error, expecting `','' or `';'' in

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread Jennifer Goodie
-- Original message from Chris Boget : -- Parse error: parse error, expecting `','' or `';'' in /usr/local/etc/httpd/domains/eazypro.com/interactive/cron_scripts/test/rate_ version.php on line 9 with line 9 being this line: var $MyVar = MyEnums::thisVar;

Re: [PHP] Referencing a constant class variable

2004-10-06 Thread David Bevan
On October 6, 2004 15:34, Chris Boget wrote: Unfortunately, in PHP4.3.2 that doesn't seem to be working... :( Does anyone know how I can access a class' variable w/o having to instantiate an object of the class? This is more to the point of what I'm trying to do: Since PHP4 doesn't have