ID: 34287
Updated by: [EMAIL PROTECTED]
Reported By: stuk88 at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: Win XP
PHP Version: 5CVS-2005-08-28 (CVS)
New Comment:
Works fine.
Previous Comments:
------------------------------------------------------------------------
[2005-08-28 14:12:03] stuk88 at gmail dot com
Description:
------------
When i try to see the first letter of a string on php5 like
$var{0} - it returns an empty string...
and when i use substr i need to start the string from 1 (not 0) and
finish on 2 (not 1) - is it a bug or a php 5 improvment?
it seems to be a problem in all the php 5 based servers
Reproduce code:
---------------
$var = "my name is stas<br>";
echo $var{0};
or
$var = "my name is stas";
echo substr($var,0,1);
Expected result:
----------------
m
m
Actual result:
--------------
---nothing---
its showing an empty page with nothing in it
and just when i use the substr with the first letter 1 and end 2 its
returns me the right thing...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34287&edit=1