Return value efficiency question
| From: | Kelly Hallman | Date: | Wed, 10 Mar 2004 07:07:33 +0000 |
| Subject: | Return value efficiency question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-179984@lists.php.net to get a copy of this message | ||
Consider this method:
function xyz() {
return $this->data = unserialize($this->serial); }
A few assumptions:
- Resultant data large enough to warrant discussion of efficiency
- I always want to store the unserialized data into the object
- The return value is only needed sometimes
If I only need to grab the return value on occassion, what is the
overhead of returning the value, if it's discarded most of the time?
Example:
$obj->xyz(); // method returns data, but nothing is done with it
Same difference?
Or better to break this out and only use return when needed?
Appreciate any expert responses. I don't know enough about the internals
of PHP to know the implications of this... thank you!
--Kelly