#48183 [Bgs]: access to associative array element by key
| From: | foolged at inbox dot ru | Date: | Tue, 12 May 2009 12:37:44 +0000 |
| Subject: | #48183 [Bgs]: access to associative array element by key | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137200@lists.php.net to get a copy of this message | ||
ID: 48183
User updated by: foolged at inbox dot ru
Reported By: foolged at inbox dot ru
Status: Bogus
Bug Type: Arrays related
Operating System: windows xp sp3
PHP Version: 5.2.9
New Comment:
I understand that you want to say that this is a consequence of
recourse to the string as to the array:
$ a = array ( 'id' => 'zxy');
echo $ a [ 'id'] [1]; // x
But such behavior should be when using a numeric key,
in the case of associative keys should be an error (an element with key
'BUG' not found).
PHP cast string 'BUG' to int 0 and returns $a['id'][0], it is logical
to you?
Previous Comments:
------------------------------------------------------------------------
[2009-05-07 16:59:42] lbarnaud@php.net
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.
------------------------------------------------------------------------
[2009-05-07 16:36:09] foolged at inbox dot ru
Description:
------------
$a = array ('id'=>'abc');
if (isset($a['id']['BUG']))
echo 'BUG!!!!!!!!';
$a = array ('id'=>'abc');
echo $a['id']['BUG']." <-BUGGGGG!!!!!!";
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48183&edit=1