PHP 4.0 Bug #6772 Updated: wrong documentaion for strrchr and strrpos

From: Date: Sat, 21 Oct 2000 17:00:39 +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-35727@lists.php.net to get a copy of this message
ID: 6772 Updated by: jmoore Reported By: tjabo@unix-ag.org Status: Closed Bug Type: Documentation problem Assigned To: Comments: The documentation is correct, although the one line description is slightly ambigious there is no real problem if you read the actual docs rather than the one line description. Previous Comments: --------------------------------------------------------------------------- [2000-10-15 08:16:25] lyric@php.net 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) --------------------------------------------------------------------------- [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

« previous php.dev (#35727) next »