#26721 [NEW]: strrpos() on strings containing null
| From: | norxh at binnews dot com | Date: | Fri, 26 Dec 2003 12:43:54 +0000 |
| Subject: | #26721 [NEW]: strrpos() on strings containing null | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-52505@lists.php.net to get a copy of this message | ||
From: norxh at binnews dot com
Operating system: RedHat 9
PHP version: 4.3.4
PHP Bug Type: Strings related
Bug description: strrpos() on strings containing null
Description:
------------
strrpos() does not return the proper values when the string contains a
null character.
strpos() works properly.
Reproduce code:
---------------
$test = "Hello";
var_dump(strpos($test, 'e'));
var_dump(strrpos($test, 'e'));
$test = "\x00Hello";
var_dump(strpos($test, 'e'));
var_dump(strrpos($test, 'e'));
$test = "Hello\x00";
var_dump(strpos($test, 'e'));
var_dump(strrpos($test, 'e'));
Expected result:
----------------
int(1)
int(1)
int(2)
int(2)
int(1)
int(1)
Actual result:
--------------
int(1)
int(1)
int(2)
bool(false)
int(1)
int(2)
--
Edit bug report at http://bugs.php.net/?id=26721&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26721&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26721&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26721&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26721&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26721&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26721&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26721&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26721&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26721&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26721&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26721&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26721&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26721&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26721&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26721&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26721&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26721&r=float