From: christoph at ziegenberg dot de Operating system: Win XP SP 2 PHP version: 5.2.0 PHP Bug Type: mbstring related Bug description: mbstring function overloading - local value ignored
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 -- Edit bug report at http://bugs.php.net/?id=39361&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39361&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39361&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39361&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39361&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39361&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39361&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39361&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39361&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39361&r=support Expected behavior: http://bugs.php.net/fix.php?id=39361&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39361&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39361&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39361&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39361&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39361&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39361&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39361&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39361&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39361&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39361&r=mysqlcfg