Re: How do you declare Vars in PHP? -I know it's not necessary, but I still want to know

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Jon M." <dsak8330225@xxxxxxxxx> wrote in message 
news:20050505050642.9114.qmail@xxxxxxxxxxxxxxxx
>I just found a place here:
>
> http://us2.php.net/manual/en/language.oop.php
>
> That has this example:
>
> /* This is how it should be done. */
> class Cart {
>   var $todays_date;
>   var $name;
>   var $owner;
>   var $items = array("VCR", "TV");
>
>   function Cart() {
>       $this->todays_date = date("Y-m-d");
>       $this->name = $GLOBALS['firstname'];
>       /* etc. . . */
>   }
> }
>
> It appears that they are declaring vars like this:
>
> var $todays_date;
>
>
> Is this something you can only do inside a class???

Yes, as has been said within this thread several times. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux