Re: usage of constants
| From: | Yasuo Ohgaki | Date: | Tue, 20 Mar 2001 13:57:53 +0000 |
| Subject: | Re: usage of constants | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44741@lists.php.net to get a copy of this message | ||
""almir"" <a.kazazic@medienhaus.co.at> wrote in message
news:997fat$jdk$1@toye.p.sourceforge.net...
> are constants global, do i have to do something in my classes so that i can
> use them as object variables, i have tested in with functions seems to be
> global but how about classes and has anybody used it realy
>
I'm not sure if I get your point or not, anyway.
Constants can be accessed from anywhere, in function, in class - NOT class
initilizer if there are expressions involved.
i.e.
classs foo {
var $something = CONSTANT1 | CONSTANT2; // This is INVALID
var $another = CONSTANT1; // This is VALID
}
I use a lots of constants with my classes.
Regards,
--
Yasuo Ohgaki
> regards
> almir
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>