PHP 4.0 Bug #6772 Updated: wrong documentaion for strrchr and strrpos
| From: | Bug Database | Date: | Sun, 15 Oct 2000 12:16:25 +0000 |
| Subject: | PHP 4.0 Bug #6772 Updated: wrong documentaion for strrchr and strrpos | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35043@lists.php.net to get a copy of this message | ||
ID: 6772
Updated by: lyric
Reported By: tjabo@unix-ag.org
Status: Analyzed
Bug Type: Documentation problem
Assigned To:
Comments:
Which documentation are you using? The _body_ of the documentation for the functions you're
talking about describes their return types correctly. (Yes, the one line summary is "find the
last occurance of a char in a
string", which is logically correct)
Previous Comments:
---------------------------------------------------------------------------
[2000-09-15 16:51:05] tjabo@unix-ag.org
I haven't found this topic in the bug database.
the docs say, both strrpos and strrchr "find the last occurance of a char in a string".
thats wrong.
- strrpos finds the last occurance of a string in a string, and returns the position.
- strrchr finds the last occurance of a string in a string, and returns the string from the position
up to the end.
Testprogram:
<h1>strrchr() / strrpos()</h2>
<?
# sttrchr/strrpos documentation bug
# testprogram
# Author: tjabo@unix-ag.org
$haystack = "bla.deoa.se_blah.deschnorg";
$needle = ".de";
$needle2 = 'o';
print "Haystack = $haystack<br>n";
print "Needle = $needle<br>n";
print "strrchr: " . strrchr($haystack, $needle) . "<br>n";
print "strrpos: " . strrpos($haystack, $needle) . ":" .
substr($haystack,strrpos($haystack, $needle),strlen($needle)) . "<br>n";
?>
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6772