#41263 [Opn]: Engine treating strings as arrays
| From: | tachu at ezboardcorp dot com | Date: | Thu, 03 May 2007 01:00:00 +0000 |
| Subject: | #41263 [Opn]: Engine treating strings as arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-112186@lists.php.net to get a copy of this message | ||
ID: 41263
User updated by: tachu at ezboardcorp dot com
Reported By: tachu at ezboardcorp dot com
Status: Open
Bug Type: Unknown/Other Function
Operating System: 2.6.20-15-386
PHP Version: 5.2.1
New Comment:
Also doing an isset($moo['cow']) returns true.
Previous Comments:
------------------------------------------------------------------------
[2007-05-03 00:56:12] tachu at ezboardcorp dot com
Description:
------------
When accessing a string by character offset php doesnt trigger error
when going out of bounds of the string or accessing a non existing
element.
Reproduce code:
---------------
<?php
$moo="asd";
var_dump($moo[444]);
var_dump($moo['cow']);
?>
Expected result:
----------------
Return false or null since the offset or index is not defined.
Actual result:
--------------
Notice: Uninitialized string offset: 444 in
/home/tachu/.thunderbird/xs4vamjr.default/moo on line 3
string(0) ""
string(1) "a"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41263&edit=1