must I use var
| From: | Peter J. Schoenster | Date: | Sun, 17 Feb 2002 20:45:31 +0000 |
| Subject: | must I use var | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-85114@lists.php.net to get a copy of this message | ||
HI,
I was reading the docs and I see this:
> /* This is how it should be done. */
> class Cart
> {
> var $todays_date;
> var $name;
> var $owner;
> var $items;
>
> function Cart()
> {
> $this->todays_date = date("Y-m-d");
> $this->name = $GLOBALS['firstname'];
> /* etc. . . */
> }
I don't see the point in doing
var $todays_date;
and
$this->todays_date = date("Y-m-d");
The latter works without the need for the "var". Why should i use
"var"?
Thanks,
Peter
http://www.readbrazil.com/
Answering Your Questions About Brazil