Bug #66563 [NEW]: strrchr ignores offset parameter
| From: | myselfasunder at gmail dot com | Date: | Thu, 23 Jan 2014 22:32:02 +0000 |
| Subject: | Bug #66563 [NEW]: strrchr ignores offset parameter | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-183978@lists.php.net to get a copy of this message | ||
From: myselfasunder at gmail dot com
Operating system: OS X 10.9.1
PHP version: 5.4.24
Package: Strings related
Bug Type: Bug
Bug description:strrchr ignores offset parameter
Description:
------------
The documentation indicates that the offset describes the number of
characters from the front of the string, and that the search will
-start- at the offset and move toward the beginning.
However, the offset seems to be ignored.
Test script:
---------------
$buffer = '01234567890123456789';
var_dump(strrpos($buffer, '0', 5));
Expected result:
----------------
int(0)
Actual result:
--------------
int(10)
--
Edit bug report at https://bugs.php.net/bug.php?id=66563&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66563&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66563&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66563&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66563&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66563&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66563&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66563&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66563&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66563&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66563&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66563&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66563&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66563&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66563&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66563&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66563&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66563&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66563&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66563&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66563&r=mysqlcfg