ID:          40791
 Updated by:  [EMAIL PROTECTED]
 Reported By: mauthi at gmx dot net
-Status:      Open
+Status:      Bogus
 Bug Type:    *General Issues
 PHP Version: 5.2.1
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2007-03-13 10:01:18] mauthi at gmx dot net

Description:
------------
In my function (see code below) i tried to return the value of an array
at position "key"
If the value is null, i want to return null - it works as shown in the
code - but if the key is not set - my function also returns "null"!

So i can't find a solution to differ "null" or "not set"!



Reproduce code:
---------------
$a = array();
// case 1:
$a["key"] = null;
// end case 1

// case 2:
// end case 2

if (isset($a["key"]))
{
        return $a["key"];
}
else
{
        if (is_null($a["key"])
            return null;
        else
            return "key not set!";
}

Expected result:
----------------
case 1:
null
case 2:
"key not set!"

Actual result:
--------------
case 1:
null
case 2:
null 
>> Undefined Index: key in XXX (in log file)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40791&edit=1

Reply via email to