Re: Question on class syntax
| From: | CPT John W. Holmes | Date: | Thu, 07 Aug 2003 18:34:30 +0000 |
| Subject: | Re: Question on class syntax | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158709@lists.php.net to get a copy of this message | ||
From: "Luis Lebron" <llebron@sigmatech.com>
> I am currently using a php class that uses the following syntax:
>
> $value= htmlcleaner::cleanup($value);
>
>
> What exactly is the :: used for? Is there a different syntax for :: ?
You're calling the cleanup() method of the "htmlcleaner" class.
You could also have:
$ob = new htmlcleaner;
$value = $ob->cleanup($value);
You can use the first method without having to actually make a new object.
Whether that's better or not depends upon your application. It basically
turns your "object" into a function repository.
---John Holmes...