RE: [PHP] Best practice question
| From: | Jon Haworth | Date: | Thu, 19 Sep 2002 17:28:43 +0000 |
| Subject: | RE: [PHP] Best practice question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-116908@lists.php.net to get a copy of this message | ||
Hi Adam,
> > What are peoples' thoughts on "one should always return
> > a value from a function, even if it's always going to be
> > true"?
> >
> I'd say skip it if you know your never returning anything
> different.
Yeah, that's what I was leaning towards :-)
What prompted the question was a constructor like this:
class foo {
var $timestamp;
function foo () {
$this->timestamp = mktime();
}
}
I just can't see any reason to return anything from it, unless someone wants
to tell me otherwise...
Cheers
Jon