From:             pg dot millon at gmail dot com
Operating system: Ubuntu
PHP version:      5.2.11
PHP Bug Type:     mbstring related
Bug description:  mb_substr_count and substr_count do not have the same 
definition

Description:
------------
I'm using the mbstring_funcoverload property defined to 7 which allows the
overload of every functions. While using the function substr_count with the
3 parameter (offset) defined. As overloading is activated, calling
substr_count is equivalent to calling mb_substr_count but the offset
parameter does not exists for this function

Reproduce code:
---------------
In php.ini: mbstring.func_overload 7

$var = substr_count('/some/path', DIRECTORY_SEPARATOR, 0);

Expected result:
----------------
1

Actual result:
--------------
Warning: mb_substr_count(): Unknown encoding "0" in php shell code on line
1

Call Stack:
    6.0376      46516   1. {main}() php shell code:0
    6.0376      46648   2. mb_substr_count() php shell code:1

-- 
Edit bug report at http://bugs.php.net/?id=49790&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49790&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49790&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49790&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49790&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49790&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49790&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49790&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49790&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49790&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49790&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49790&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49790&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49790&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49790&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49790&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49790&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49790&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49790&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49790&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49790&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49790&r=mysqlcfg

Reply via email to