ID:               43889
 Updated by:       [EMAIL PROTECTED]
 Reported By:      rharrell at imagiclab dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: RH Enterprise 4
 PHP Version:      5.2CVS-2008-01-18 (snap)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




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

[2008-01-18 18:57:43] rharrell at imagiclab dot com

Description:
------------
If a variable is set to a string and isset() is used to check an array
key for that variable it returns true.

Reproduce code:
---------------
$var="foo";
if(isset($var['ed']))
{
        //why are we in this section if $var is a string?
        if(is_array($var))
        {
                // This doesn't happen
                echo "It's an array";
        }
        else
        {
                // And yet this returns "f"
                echo $var['ed'];
        }
}


Expected result:
----------------
I would expect isset to return false;

Actual result:
--------------
isset returns true, because a check for any associative array index for
the var will return the first character.


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


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

Reply via email to