Bug with substr in RC8
| From: | Liz | Date: | Tue, 01 May 2001 16:38:56 +0000 |
| Subject: | Bug with substr in RC8 | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-2981@lists.php.net to get a copy of this message | ||
OK, As promised Ive been doing some testing, and it seems that by chance I
found something odd..
A script such as
<?
$a="a";
echo "$a=a\n";
echo "length of $a=".strlen($a)."\n";
echo "first 2 characters of $a are ".substr($a,1);
echo "test completed";
?>
Results in the wrong results. substr($a,1) does not result in a, in fact it
results in nothing at all. (this was on linux), but on windows, I had managed
(dont ask) to do substr($somestring,2,length($somestring)-6); however, of
course length is the wrong function so returned 1 and so I did -5 .. but
instead of moaning, my script just stopped, no errors nothing....
Is it just me?? I can drag out the src for it, it was in the middle of
something obscure I was working on today..
Liz