Re: [PHP4BETA] Php Classes Function ??
| From: | Sterling Hughes | Date: | Tue, 18 Apr 2000 14:43:58 +0000 |
| Subject: | Re: [PHP4BETA] Php Classes Function ?? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13674@lists.php.net to get a copy of this message | ||
Catalin Ciocoiu wrote:
> When a funtion member of the object access a properties of the same
> object
> must I specify $this->var ???? Can I use $var ?????
If you are asking what I think you are, no and yes.
No you cannot directly access a variable in a class without using the
$this variable. However, you can do the following:
$var = &$this->var; .// Now $var points to $this->var
$var = 4;
echo $this->var; // prints 4
echo $var; // also prints 4
Sterling