#41263 [Opn->Bgs]: Engine treating strings as arrays
| From: | tony2001@php.net | Date: | Thu, 03 May 2007 10:30:18 +0000 |
| Subject: | #41263 [Opn->Bgs]: Engine treating strings as arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-112198@lists.php.net to get a copy of this message | ||
ID: 41263
Updated by: tony2001@php.net
Reported By: tachu at ezboardcorp dot com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: 2.6.20-15-386
PHP Version: 5.2.1
New Comment:
That's how it works since the very beginning.
Previous Comments:
------------------------------------------------------------------------
[2007-05-03 01:00:00] tachu at ezboardcorp dot com
Also doing an isset($moo['cow']) returns true.
------------------------------------------------------------------------
[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