Re: Re: $this->value VS $value
| From: | uaca man | Date: | Tue, 23 Sep 2008 17:38:04 +0000 |
| Subject: | Re: Re: $this->value VS $value | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280799@lists.php.net to get a copy of this message | ||
Just for closure: so many year believing that $value and $this->value
was the same!!!
Tks everyone for the quick answer :)
Ângelo
2008/9/23 Colin Guthrie <gmane@colin.guthr.ie>:
> Nathan Rixham wrote:
>>
>> yeah that's right; add in one more line and the reason why is apparent..
>
> Well I think "is apparent" is a bit strong considering e.g. C++ syntax where
> syntax is equally valid but the semantics are different.
>
> So to answer the OPs question, yes this is different in PHP compared to
> other languages. I think this is due to the fact that classes are kinda
> bolted on in PHP and there isn't really such a thing as "being in a class"
> in terms of scoping. $this is allows the class scope to be kind of emulated
> inside a functional scope.
>
> I could be wrong here, but that's my understanding of it.
>
> Col
>
> --
>
> Colin Guthrie
> gmane(at)colin.guthr.ie
> http://colin.guthr.ie/
>
> Day Job:
> Tribalogic Limited [http://www.tribalogic.net/]
> Open Source:
> Mandriva Linux Contributor [http://www.mandriva.com/]
> PulseAudio Hacker [http://www.pulseaudio.org/]
> Trac Hacker [http://trac.edgewall.org/]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>