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

From: Date: Wed, 30 May 2007 17:27:04 +0000
Subject: Re: Return or not to return, that is the question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-255826@lists.php.net to get a copy of this message
On Wed, May 30, 2007 7:42 am, Darren Whitlen wrote: > 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? I guess if you're using lots of OOP and try/catch/throw, you'd end up very rarely having a function return a pass/fail value... Just depends on coding style, I guess. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#255826) next »