|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-03 17:28 UTC] christoph at ziegenberg dot de
[2006-11-03 18:06 UTC] christoph at ziegenberg dot de
[2006-12-09 17:59 UTC] christoph at ziegenberg dot de
[2006-12-21 18:15 UTC] christoph at ziegenberg dot de
[2006-12-22 02:58 UTC] masugata@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
Description: ------------ I got a new error message in PHP 5.2 when using mb_strstr() with an empty string as haystack. So I wrote a testfile to compare the behaviour of strstr() with mb_strstr(). Although mbstring function overloading is not enabled and the phpinfo() output (in the same file, so there are no more changes via .htaccess) says that all mbstring settings are the default settings, strstr() is overloaded with mb_strstr(). phpinfo output: --- Multibyte Support enabled Multibyte string engine libmbfl Multibyte (japanese) regex support enabled Multibyte regex (oniguruma) version 4.4.4 Multibyte regex (oniguruma) backtrack check On mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1. Directive Local Value Master Value mbstring.detect_order no value no value mbstring.encoding_translation Off Off mbstring.func_overload 0 0 mbstring.http_input pass pass mbstring.http_output pass pass mbstring.internal_encoding no value no value mbstring.language neutral neutral mbstring.strict_detection Off Off mbstring.substitute_character no value no value --- Reproduce code: --------------- <?php //phpinfo(); strstr('', ','); mb_strstr('', ','); ?> Expected result: ---------------- Warning: strstr() [function.strstr]: Empty haystack in W:\www\strstr\strstr.php on line 3 Warning: mb_strstr() [function.mb-strstr]: Empty haystack in W:\www\strstr\strstr.php on line 4 Actual result: -------------- Warning: mb_strstr() [function.mb-strstr]: Empty haystack in W:\www\strstr\strstr.php on line 3 Warning: mb_strstr() [function.mb-strstr]: Empty haystack in W:\www\strstr\strstr.php on line 4