From: hipolitoalvarez at yahoo dot com dot ar
Operating system: Windows/Apache2
PHP version: 4.4.4
PHP Bug Type: *Programming Data Structures
Bug description: Problem with IF sentence

Description:
------------
The problem begins when i compare an expression in IF sentence.
When i compare a STRING with another STRING(component of array).

For example: if ($b != $a[$x]) this always gives me a TRUE even if $b=3
and $a[$x]=3.

For example: if ($b == $a[$x]) this always gives me a FALSE even if $b=3
and $a[$x]=3.

Reproduce code:
---------------
example: $indice(ARRAY) = 1 | 2 | 3 | 4 | 5 |
example: $id = 3
<?
$cant = count($indice);
$id = $_POST[cual];
$x = 0;
while ($x < $cant){
if ($id <> $indice[$x]) {
....several sentences...
}
$x++;
}
?>



Expected result:
----------------
Ill expect when the "if" sentence compare the expression, if the values
are equals, expression begin FALSE, if are not equals, expression begin
TRUE, but are always TRUE even when bot variables have the same value.
If i change the disctinct comparation sign (<> or !=) to an equal sign (==
or ===) always give me the result of FALSE, so dont enter into IF sentence.


--
Edit bug report at [url]http://bugs.php.net/?id=39264&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39264&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39264&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39264&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39264&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=39264&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=39264&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39264&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=39264&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=39264&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=39264&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=39264&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=39264&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=39264&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39264&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=39264&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=39264&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39264&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=39264&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39264&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39264&r=mysqlcfg[/url]