#49068 [Opn->Ver]: Associative array index doesn't produce a notice
| From: | jani@php.net | Date: | Sun, 26 Jul 2009 22:28:04 +0000 |
| Subject: | #49068 [Opn->Ver]: Associative array index doesn't produce a notice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140295@lists.php.net to get a copy of this message | ||
ID: 49068
Updated by: jani@php.net
Reported By: simon+php at thulbourn dot com
-Status: Open
+Status: Verified
-Bug Type: Arrays related
+Bug Type: Scripting Engine problem
Operating System: *
-PHP Version: 5.3.0
+PHP Version: 5.*, 6SVN (2009-07-26)
Previous Comments:
------------------------------------------------------------------------
[2009-07-26 22:09:07] simon+php at thulbourn dot com
Description:
------------
An array with no associative keys doesn't throw a notice or error when
one is used as an associative keyed array.
Reproduce code:
---------------
<?php
$array = array('foo', 'bar', 'baz');
foreach ($array as $a) {
echo $a['foo'];
}
?>
Expected result:
----------------
Notice: Undefined index
Actual result:
--------------
fbb
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49068&edit=1