#19229 [NEW]: isset() handles NULL values incorrectly
| From: | flying at dom dot natm dot ru | Date: | Wed, 04 Sep 2002 12:06:13 +0000 |
| Subject: | #19229 [NEW]: isset() handles NULL values incorrectly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-18406@lists.php.net to get a copy of this message | ||
From: flying@dom.natm.ru
Operating system: Windows 2000
PHP version: 4.2.2
PHP Bug Type: Scripting Engine problem
Bug description: isset() handles NULL values incorrectly
Take a look at the following example:
<?php
$array = array('foo',null,'bar');
foreach($array as $key=>$value)
echo "Set: ".((isset($array[$key]))?'yes':'no')."\nValue:
".serialize($value)."\n\n";
?>
It returns following result:
Set: yes
Value: s:3:"foo";
Set: no
Value: N;
Set: yes
Value: s:3:"bar";
As you can see - isset() returns FALSE for array item, containing NULL
value, but it should return TRUE because array item itself is set and have
value.
--
Edit bug report at http://bugs.php.net/?id=19229&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19229&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19229&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19229&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19229&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19229&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19229&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19229&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19229&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19229&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19229&r=globals