Bug #16223 Updated: Nested If block not execute correctly
| From: | amin dot javanbakht at openwave dot com | Date: | Fri, 22 Mar 2002 18:26:06 +0000 |
| Subject: | Bug #16223 Updated: Nested If block not execute correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-3157@lists.php.net to get a copy of this message | ||
ID: 16223
Updated by: amin.javanbakht@openwave.com
Reported By: amin.javanbakht@openwave.com
Status: Bogus
Bug Type: *Regular Expressions
Operating System: SUN
PHP Version: 4.1.2
New Comment:
>>If the fruit is not blue or the fruit is not red, do something.
The problem is when the fruit is blue, it still return true, but it has
to return false
Previous Comments:
------------------------------------------------------------------------
[2002-03-22 13:20:45] rasmus@php.net
Logic 101
If the fruit is not blue or the fruit is not red, do something.
Since the fruit can only be one colour, that logic will always return
true.
------------------------------------------------------------------------
[2002-03-22 13:11:33] amin.javanbakht@openwave.com
if ( ( $name != "test1" ) || ( $name != "test2" ) )
does not work properly.
if I Do each condition seperately, it works but If I join them using
|| then this never works
however this works fine
if ( ( $name == "test1" ) || ( $name == "test2" ) )
it seems like the problem occurs only with "!=" condition
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16223&edit=1