PHP 4.0 Bug #8800: Unexpected string comparison behaviour
| From: | paul dot rees at surfeu dot com | Date: | Fri, 19 Jan 2001 10:57:02 +0000 |
| Subject: | PHP 4.0 Bug #8800: Unexpected string comparison behaviour | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44543@lists.php.net to get a copy of this message | ||
From: paul.rees@surfeu.com
Operating system: Suse Linux 7.0
PHP version: 4.0.4pl1
PHP Bug Type: *General Issues
Bug description: Unexpected string comparison behaviour
$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 . '" ??';
--
Edit Bug report at: http://bugs.php.net/?id=8800&edit=1