Returning an object
| From: | Aidan Lister | Date: | Fri, 07 May 2004 01:35:24 +0000 |
| Subject: | Returning an object | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-185579@lists.php.net to get a copy of this message | ||
How _should_ this be done? In terms of "best practice".
<?php
function foobar ()
{
return new SomeObject;
}
?>
Or:
<?php
function barfoo ()
{
$tempvar = new SomeObject;
return $tempvar
}
?>
Please don't reply if you really, really don't know what you are talking
about.