RE: [PHP] Re: Looking for caveats to the following code

2006-08-18 Thread Ford, Mike
On 17 August 2006 23:28, Adam Zey wrote: Better to do this: if ( ($result = do_something('hello')) !== false ) { // do something with $result } else { // do some other stuff } The result of an assignment like $result = do_something('hello') is itself the result you

[PHP] Re: Looking for caveats to the following code

2006-08-17 Thread Adam Zey
Chris W. Parker wrote: Hello, While experimenting with some object stuff I stumbled upon something new (although not object related). Normally I would do this: ?php function do_something($input) { if($input == 'hello') { return $input; } else { return false; } } $result