For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > December 2006 > private, protected, static vars









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author private, protected, static vars
Koncept

2006-12-23, 6:57 pm


Could somebody please inform me what the difference between setting a
variable as private is compared to protected within a class? I can't
see the difference and would appreciate a brief example. I suspect
this has more to do with subclassing but it eludes me... Also, when is
it appropriate to set a variable to *static* ? Examples are welcome.

Thanks in advance.

--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche
-Lost

2006-12-23, 6:57 pm

"Koncept" <user@unknown.invalid> wrote in message
news:231220061543354983%user@unknown.invalid...
>
> Could somebody please inform me what the difference between setting a
> variable as private is compared to protected within a class? I can't
> see the difference and would appreciate a brief example. I suspect
> this has more to do with subclassing but it eludes me... Also, when is
> it appropriate to set a variable to *static* ? Examples are welcome.


Look up "Static Keyword" and "Visibility" under "Classes and Objects (PHP 5)" in the
manual.

Those should explain it decently enough, if not, repost.

-Lost


Koncept

2006-12-23, 6:57 pm

In article <v7idnYOubpU1AxDYnZ2dnUVZ_s-rnZ2d@comcast.com>, -Lost
<spam_ninjaREMOVEME@REMOVEMEcomcast.net> wrote:

> Look up "Static Keyword" and "Visibility" under "Classes and Objects (PHP 5)"
> in the
> manual.
>
> Those should explain it decently enough, if not, repost.
>
> -Lost


Cheers.

--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com