Re: else needed?

From: Date: Sun, 13 Jul 2003 01:01:39 +0000
Subject: Re: else needed?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-155929@lists.php.net to get a copy of this message
From: "Larry Brown" <larry.brown@dimensionnetworks.com> > On if statements, I periodically don't want anything to happen if the > requisite is not met. In most cases just writing the statement in the > format if (this) { do that; } and nothing more will work. However, I > periodically get weird results with this and found the only fix was to do > a... if (this) {do that;}else{"echo "";} I experienced the same problem once... It really amazed me... I had some conditions like: if ( some_thing ){ do_something } if ( some_other_thing ){ do_something_else } if ( yet_another_thing ){ do_another_more_thing } they were stupid conditions, with no possibility of error... I checked them many times to see if I was not having some stupid error, but there was no error The results were weird, and not as expected unless I added an else statement.. It was on a Red Hat 7.1 system, but I can't remember the exact PHP version maybe it was a bug, but I had the same problem, and it was definitively not an error of my code.. Regards, Juan

« previous php.general (#155929) next »