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

From: Date: Fri, 18 Aug 2006 01:40:08 +0000
Subject: RE: [PHP] Looking for caveats to the following code
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-240839@lists.php.net to get a copy of this message
At 4:16 PM -0700 8/17/06, Chris W. Parker wrote:
tedd <mailto:tedd@sperling.com>
    on Thursday, August 17, 2006 3:58 PM said:
You can shorten it even further by: if(do_something('hello'))
     {
    // do something with $result
     }
else
     {
    // do some other stuff
     }
This actually won't work because $result is not being assigned anywhere.
Ahhh yes , I didn't catch that. Sorry to all.
http://xn--ovg.com/a14.php Your page should show the source, otherwise it's impossible to tell what's happening.
I didn't think that necessary considering that I posted what I was doing. But, I posted it again in my example -- please review: http://xn--ovg.com/a14.php I see now why I got the same result as you -- $result was never cleared.
Yeah, I guess as long as I'm just testing for true or false it'll be ok.
The example isn't checking for true/false but rather "not-null/false" Cheers. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#240839) next »