#41263 [NEW]: Engine treating strings as arrays
| From: | tachu at ezboardcorp dot com | Date: | Thu, 03 May 2007 00:56:12 +0000 |
| Subject: | #41263 [NEW]: Engine treating strings as arrays | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-112185@lists.php.net to get a copy of this message | ||
From: tachu at ezboardcorp dot com
Operating system: 2.6.20-15-386
PHP version: 5.2.1
PHP Bug Type: Unknown/Other Function
Bug description: Engine treating strings as arrays
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 bug report at http://bugs.php.net/?id=41263&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41263&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41263&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41263&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41263&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41263&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41263&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41263&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41263&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41263&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41263&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41263&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41263&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41263&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41263&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41263&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41263&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41263&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41263&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41263&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41263&r=mysqlcfg