Re: What is 'var'
| From: | Stanislav Malyshev | Date: | Wed, 05 Jul 2000 07:55:47 +0000 |
| Subject: | Re: What is 'var' | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23534@lists.php.net to get a copy of this message | ||
j>> Hmm, but my point was that I could do that without the word 'var'.
j>>
j>> The word 'var' seems to have no reason for its existence, for instance,
j>> this should work (but doesn't).
j>> class foo {
j>> $foo_var = 0;
j>> }
You could omit word 'class' too. And { } and = and ; are optional. Like
this:
foo: foo_far 0
foo_func($a) a + a b
Doesn't this remind you those lovely assembler days? ;)
Seriaously, var allows you (and parser) to distinguish class initializers
from some assignment left out of some function.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665