Re: Return or not to return, that is the question

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

 



Chris Boget wrote:
If there is no need to return a value then I don't do so. However, the function is going to process something, and surely you should check that the processing has succeeded or failed?

This is precisely the point I was going to make.  Unless an argument is
passed in by reference for manipulation within the function, I can't
think of a reason why you wouldn't want to return a value; true or false
at the very least.  You call a function to perform, well, a function.  I
would think that you would want to know whether or not the process
within the function was successful, yes?

thnx,
Chris

All depends on the function.

function someFunc(){
	$this->counter++;
	if($this->counter > 100) $this->counter = 0;
}


Something that simple wont need a return at all.

--
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