I have a question that may seem kind of silly, but I'm curious...
When using PHP why would one use "var" to define a variable as opposed to
just regularly creating it?
For example, if I have a class defined as below:
<pre>
class Simple {
var $a;
function Simple() {
$this->a = 5;
}
function first() {
return $this->a;
}
}
</pre>
This class, when created, sets the variable $a to 5, and the function first
returns the value in $a.... my question is could I omit the var and still
have it function in this fashion? What is the purpose of it?
Also, can I access this variable through the same -> convention, i.e. would
the following be allowed?
<pre>
$test = new Simple();
echo $test->a;
</pre>
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]