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
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,
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
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
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
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
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
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
-- 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;
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
10 matches
Mail list logo