#39364 [Opn->Bgs]: mb_strstr() behaviour differs from strstr()

From: Date: Fri, 03 Nov 2006 19:56:40 +0000
Subject: #39364 [Opn->Bgs]: mb_strstr() behaviour differs from strstr()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104339@lists.php.net to get a copy of this message
ID: 39364 Updated by: iliaa@php.net Reported By: christoph at ziegenberg dot de -Status: Open +Status: Bogus Bug Type: mbstring related Operating System: Win XP SP 2 PHP Version: 5.2.0 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. dupe of 39361 Previous Comments: ------------------------------------------------------------------------ [2006-11-03 17:38:23] christoph at ziegenberg dot de 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 this bug report at http://bugs.php.net/?id=39364&edit=1

« previous php.bugs (#104339) next »