#39364 [NEW]: mb_strstr() behaviour differs from strstr()
| From: | christoph at ziegenberg dot de | Date: | Fri, 03 Nov 2006 17:38:23 +0000 |
| Subject: | #39364 [NEW]: mb_strstr() behaviour differs from strstr() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-104327@lists.php.net to get a copy of this message | ||
From: christoph at ziegenberg dot de
Operating system: Win XP SP 2
PHP version: 5.2.0
PHP Bug Type: mbstring related
Bug description: mb_strstr() behaviour differs from strstr()
Description:
------------
as described in the more important bug #39361 i compared strstr() and
mb_strstr().
mb_strstr() produces the following error when using an empty haystack:
Warning: mb_strstr() [function.mb-strstr]:
Empty haystack in X on line Y
but strstr() doesn't.
Reproduce code:
---------------
<?php
strstr('', ',');
mb_strstr('', ',');
?>
Expected result:
----------------
no error message - because haystack does not contain needle, so the
function should return false, as described in the documentation. the
different behavior produces a lot of errors when using function
overloading (although i know using it is not a good idea... ;).
Actual result:
--------------
Warning: mb_strstr() [function.mb-strstr]: Empty haystack in X on line Y
--
Edit bug report at http://bugs.php.net/?id=39364&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39364&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39364&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39364&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39364&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39364&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39364&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39364&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39364&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39364&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39364&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39364&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39364&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39364&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39364&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39364&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39364&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39364&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39364&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39364&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39364&r=mysqlcfg