Re: What is 'var'
| From: | jalal | Date: | Wed, 05 Jul 2000 06:45:48 +0000 |
| Subject: | Re: What is 'var' | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23525@lists.php.net to get a copy of this message | ||
On Wed, 05 Jul 2000 00:59:01 +0200, waldschrott wrote:
> > Well, I know it declares a variable in a class. But why is it
> > necessary?
> > Any variable declared in a class will be part of that class.
> >
> > Does 'var' serve some other purpose?
>
>
>1. initialization
>var $foo='init';
Hmm, but my point was that I could do that without the word 'var'.
The word 'var' seems to have no reason for its existence, for instance,
this should work (but doesn't).
class foo {
$foo_var = 0;
}
Semantically, $foo_var is a class variable because its definition is in
a class.
Ah well, one of the mysteries of PHP.
- jalal -