#46763 [NEW]: stristr() wrong output when needle does not exist
| From: | ant@php.net | Date: | Fri, 05 Dec 2008 14:00:48 +0000 |
| Subject: | #46763 [NEW]: stristr() wrong output when needle does not exist | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-131629@lists.php.net to get a copy of this message | ||
From: ant@php.net
Operating system: Windows, Linux and Linux 64 bit
PHP version: 5.3CVS-2008-12-05 (snap)
PHP Bug Type: mbstring related
Bug description: stristr() wrong output when needle does not exist
Description:
------------
Take a look at the mb_stristr_basic.phpt test just checked into 5.3/6.0.
The test passes fine on 5.2 and fails on 5.3 and 6.0.
Reproduce code:
---------------
ext/mbstring/tests/mb_stristr_basic.phpt
Expected result:
----------------
*** Testing mb_stristr() : basic functionality ***
-- ASCII string: needle exists --
string(10) "6263646566"
string(10) "6263646566"
string(2) "61"
-- ASCII string: needle doesn't exist --
bool(false)
-- Multibyte string: needle exists --
string(52) "cebccebdcebecebfcf80cf81cf83cf84cf85cf86cf87cf88cf89"
string(52) "cebccebdcebecebfcf80cf81cf83cf84cf85cf86cf87cf88cf89"
string(44) "ceb1ceb2ceb3ceb4ceb5ceb6ceb7ceb8ceb9cebacebb"
-- Multibyte string: needle doesn't exist --
bool(false)
===DONE===
Actual result:
--------------
*** Testing mb_stristr() : basic functionality ***
-- ASCII string: needle exists --
string(10) "6263646566"
string(10) "6263646566"
string(2) "61"
-- ASCII string: needle doesn't exist --
string(6) "abcdef"
-- Multibyte string: needle exists --
string(52) "cebccebdcebecebfcf80cf81cf83cf84cf85cf86cf87cf88cf89"
string(52) "cebccebdcebecebfcf80cf81cf83cf84cf85cf86cf87cf88cf89"
string(44) "ceb1ceb2ceb3ceb4ceb5ceb6ceb7ceb8ceb9cebacebb"
-- Multibyte string: needle doesn't exist --
string(48)
"αβγδεζηθικλμνξοÏÏÏÏÏ
ÏÏÏÏ"
===DONE===
--
Edit bug report at http://bugs.php.net/?id=46763&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46763&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46763&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46763&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46763&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46763&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46763&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46763&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46763&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46763&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46763&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46763&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46763&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46763&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46763&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46763&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46763&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46763&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46763&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46763&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46763&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46763&r=mysqlcfg