PHP 4.0 Bug #8800 Updated: Unexpected string comparison behaviour
| From: | zak@php.net | Date: | Fri, 19 Jan 2001 11:01:35 +0000 |
| Subject: | PHP 4.0 Bug #8800 Updated: Unexpected string comparison behaviour | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44544@lists.php.net to get a copy of this message | ||
ID: 8800
Updated by: zak
Reported By: paul.rees@surfeu.com
Old-Status: Open
Status: Bogus
Bug Type: *General Issues
Assigned To:
Comments:
This is the expected behavior.
Use the === operator to check for explicit (type and value) equality.
Previous Comments:
---------------------------------------------------------------------------
[2001-01-19 05:57:02] paul.rees@surfeu.com
$var1 = "0000009"; // string
settype ($var1, 'string'); // ...but just to be sure
echo 'var1 is a ' . gettype ($var1) . "<BR>n";
$var2 = "9"; // string
settype ($var2, 'string'); // ...but just to be sure
echo 'var2 is a ' . gettype ($var2) . "<BR>n";
if ($var1 == $var2)
echo '...which seems to indicate that "' . $var1 . '" is the same as
"' . $var2 . '" ??';
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8800