BC broken for strrpos()/strripos()

From: Date: Wed, 03 Dec 2003 00:27:50 +0000
Subject: BC broken for strrpos()/strripos()
Groups: php.internals 
Request: Send a blank email to internals+get-6031@lists.php.net to get a copy of this message
Hi devs, this night i saw that the BC of strrpos()/strripos() is broken by a patch commited by pollita 7 months ago : http://cvs.php.net/diff.php/php-src/ext/standard/string.c?login=2&r1=1.370&r2=1.371&ty=u The documenation of both function states if the second parameter is an integer instead of string then its value is used as a ord of the character to be used during the search. This no more true with HEAD. A script to reproduce : <?php var_dump(strrpos("ABCDEF","DEF")); var_dump(strrpos("ABCDEF","DAF")); var_dump(strrpos("ABCDEF",ord("D"))); ?> HEAD : int(3) bool(false) bool(false) PHP 4.3.5-dev (cli) (built: Dec 2 2003 00:13:37) (DEBUG): int(3) int(3) int(3) What do you think? Is it ok to break the BC here or not? As you see the other change introduced with the patch is to use the whole needle string while searching, not only the first character. Comments are welcome, Andrey

« previous php.internals (#6031) next »