Bug #16568: string comparison features give opposing results
| From: | lent at fstrf dot org | Date: | Fri, 12 Apr 2002 14:46:53 +0000 |
| Subject: | Bug #16568: string comparison features give opposing results | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-4746@lists.php.net to get a copy of this message | ||
From: lent@fstrf.org
Operating system: SunOS 5.6
PHP version: 4.1.2
PHP Bug Type: Strings related
Bug description: string comparison features give opposing results
NOTE: in the examples below the $myrow array is a string array populated by
an ingres select statement.
if $myrow[6] is null going into the first example then
$myrow[6] will not be set to &npsp, but in the second example it will.
Shouldn't these two examples be equivalent? Also strcmp function behaves
like example 1.
EXAMPLE 1:
trim($myrow[6]);
($myrow[6]) == " " ? $myrow[6] = " ")
EXAMPLE 2:
trim($myrow[6]);
(ord($myrow[6]) == 32 ? $myrow[6] = " ");
--
Edit bug report at http://bugs.php.net/?id=16568&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16568&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16568&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16568&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16568&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16568&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16568&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16568&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16568&r=submittedtwice