#37727 [Opn->Bgs]: isset return a false positive between array key and string
| From: | tony2001@php.net | Date: | Wed, 07 Jun 2006 13:10:18 +0000 |
| Subject: | #37727 [Opn->Bgs]: isset return a false positive between array key and string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98135@lists.php.net to get a copy of this message | ||
ID: 37727
Updated by: tony2001@php.net
Reported By: decryptus at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 4.4.2
New Comment:
'bar' is converted to 0 and $foo[0] IS set.
No bug here.
Previous Comments:
------------------------------------------------------------------------
[2006-06-07 13:07:03] decryptus at gmail dot com
Description:
------------
There is a problem when I test if an array key exists on a string with
the function isset().
isset return true but $foo is not an array and error_reporting doesn't
display an error.
Reproduce code:
---------------
$foo = 'foo';
var_dump($foo);
echo '<br />';
var_dump(isset($foo['bar']));
Expected result:
----------------
string(3) "foo"
bool(false)
Actual result:
--------------
string(3) "foo"
bool(true)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37727&edit=1