#44431 [Csd]: Isset fails on using a string as a multidimensional array
| From: | felipe@php.net | Date: | Thu, 13 Mar 2008 14:12:26 +0000 |
| Subject: | #44431 [Csd]: Isset fails on using a string as a multidimensional array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-123287@lists.php.net to get a copy of this message | ||
ID: 44431
Updated by: felipe@php.net
Reported By: spencer dot rinehart at dominionenterprises dot com
Status: Closed
Bug Type: Strings related
Operating System: Fedora 8/Linux
PHP Version: 5.2.5
New Comment:
5.2.6 doesn't throws fatal error.
Previous Comments:
------------------------------------------------------------------------
[2008-03-13 14:12:24] felipe@php.net
5.2.6 doesn't throws fatal error.
------------------------------------------------------------------------
[2008-03-13 13:48:34] spencer dot rinehart at dominionenterprises dot
com
Description:
------------
isset throws a fatal error when passing a string offset as an array of
depth 3 or more when expected behavior would be it returning false.
Reproduce code:
---------------
$string='';
if(isset($string['test']['test']))
echo "true\n";
else
echo "false\n";
if(isset($string['test']['test']['test']))
echo "true\n";
else
echo "false\n";
Expected result:
----------------
false
false
Actual result:
--------------
false
PHP Fatal error: Cannot use string offset as an array in
/home/anubis/test.php on line 8
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44431&edit=1