ID:               39400
 Updated by:       [EMAIL PROTECTED]
 Reported By:      s dot masugata at mbg dot nifty dot com
-Status:           Feedback
+Status:           Closed
 Bug Type:         mbstring related
 Operating System: Win XP
 PHP Version:      5.2.0
 Assigned To:      masugata
 New Comment:

http://bugs.php.net/bug.php?id=39361




Previous Comments:
------------------------------------------------------------------------

[2006-12-21 18:00:56] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Hi! :)

I'm fixed this problem(just now).
http://news.php.net/php.cvs/42277

Please, try snapshot.

[tested spript]:

<?php

print("\n------[strpos (empty haystack):]---------\n");
var_dump(    strpos( '', '' ) );
var_dump( mb_strpos( '', '' ) );

print("\n------[strpos (empty needle):]---------\n");
var_dump(    strpos( '1', '' ) );
var_dump( mb_strpos( '1', '' ) );

print("\n------[strpos (needle > haystack):]---------\n");
var_dump(    strpos('1', '100' ) );
var_dump( mb_strpos('1', '100' ) );

print("\n------[strpos (offest > haystack):]---------\n");
var_dump(    strpos( '1', '1', 4 ) );
var_dump( mb_strpos( '1', '1', 4 ) );

print("\n------[stripos (empty haystack):]---------\n");
var_dump(    stripos( '', '' ) );
var_dump( mb_stripos( '', '' ) );

print("\n------[stripos (empty needle):]---------\n");
var_dump(    stripos( '1', '' ) );
var_dump( mb_stripos( '1', '' ) );

print("\n------[stripos (needle > haystack):]---------\n");
var_dump(    stripos('1', '100' ) );
var_dump( mb_stripos('1', '100' ) );

print("\n------[stripos (offest > haystack):]---------\n");
var_dump(    stripos( '1', '1', 4 ) );
var_dump( mb_stripos( '1', '1', 4 ) );

print("\n------[strrpos (empty haystack):]---------\n");
var_dump(    strrpos( '', '' ) );
var_dump( mb_strrpos( '', '' ) );

print("\n------[strrpos (empty needle):]---------\n");
var_dump(    strrpos( '1', '' ) );
var_dump( mb_strrpos( '1', '' ) );

print("\n------[strrpos (needle > haystack):]---------\n");
var_dump(    strrpos('1', '100' ) );
var_dump( mb_strrpos('1', '100' ) );

print("\n------[strrpos (offest > haystack):]---------\n");
var_dump(    strrpos( '1', '1', 4 ) );
var_dump( mb_strrpos( '1', '1', 4 ) );

print("\n------[strripos (empty haystack):]---------\n");
var_dump(    strripos( '', '' ) );
var_dump( mb_strripos( '', '' ) );

print("\n------[strripos (empty needle):]---------\n");
var_dump(    strripos( '1', '' ) );
var_dump( mb_strripos( '1', '' ) );

print("\n------[strripos (needle > haystack):]---------\n");
var_dump(    strripos('1', '100' ) );
var_dump( mb_strripos('1', '100' ) );

print("\n------[strripos (offest > haystack):]---------\n");
var_dump(    strripos( '1', '1', 4 ) );
var_dump( mb_strripos( '1', '1', 4 ) );

print("\n------[strstr (empty haystack):]---------\n");
var_dump(    strstr( '', '' ) );
var_dump( mb_strstr( '', '' ) );

print("\n------[strstr (empty needle):]---------\n");
var_dump(    strstr( '1', '' ) );
var_dump( mb_strstr( '1', '' ) );

print("\n------[strstr (needle > haystack):]---------\n");
var_dump(    strstr('1', '100' ) );
var_dump( mb_strstr('1', '100' ) );

print("\n------[stristr (empty haystack):]---------\n");
var_dump(    stristr( '', '' ) );
var_dump( mb_stristr( '', '' ) );

print("\n------[stristr (empty needle):]---------\n");
var_dump(    stristr( '1', '' ) );
var_dump( mb_stristr( '1', '' ) );

print("\n------[stristr (needle > haystack):]---------\n");
var_dump(    stristr('1', '100' ) );
var_dump( mb_stristr('1', '100' ) );

print("\n------[strrchr (empty haystack):]---------\n");
var_dump(    strrchr( '', '' ) );
var_dump( mb_strrchr( '', '' ) );

print("\n------[strrchr (empty needle):]---------\n");
var_dump(    strrchr( '1', '' ) );
var_dump( mb_strrchr( '1', '' ) );

print("\n------[substr_count (empty haystack):]---------\n");
var_dump(    substr_count( '', '' ) );
var_dump( mb_substr_count( '', '' ) );

print("\n------[substr_count (empty needle):]---------\n");
var_dump(    substr_count( '1', '' ) );
var_dump( mb_substr_count( '1', '' ) );

print("\n------[substr_count (needle > haystack):]---------\n");
var_dump(    substr_count('1', '100' ) );
var_dump( mb_substr_count('1', '100' ) );

?>

[php.ini setting]:

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


[result]:

------[strpos (empty haystack):]---------

Warning: strpos(): Empty delimiter. in /usr/local/src/wk/39400.php on
line 4
bool(false)

Warning: mb_strpos(): Empty delimiter. in /usr/local/src/wk/39400.php
on line 5
bool(false)

------[strpos (empty needle):]---------

Warning: strpos(): Empty delimiter. in /usr/local/src/wk/39400.php on
line 8
bool(false)

Warning: mb_strpos(): Empty delimiter. in /usr/local/src/wk/39400.php
on line 9
bool(false)

------[strpos (needle > haystack):]---------
bool(false)
bool(false)

------[strpos (offest > haystack):]---------

Warning: strpos(): Offset not contained in string. in
/usr/local/src/wk/39400.php on line 16
bool(false)

Warning: mb_strpos(): Offset not contained in string. in
/usr/local/src/wk/39400.php on line 17
bool(false)

------[stripos (empty haystack):]---------
bool(false)
bool(false)

------[stripos (empty needle):]---------
bool(false)
bool(false)

------[stripos (needle > haystack):]---------
bool(false)
bool(false)

------[stripos (offest > haystack):]---------

Warning: stripos(): Offset not contained in string. in
/usr/local/src/wk/39400.php on line 33
bool(false)

Warning: mb_stripos(): Offset not contained in string. in
/usr/local/src/wk/39400.php on line 34
bool(false)

------[strrpos (empty haystack):]---------
bool(false)
bool(false)

------[strrpos (empty needle):]---------
bool(false)
bool(false)

------[strrpos (needle > haystack):]---------
bool(false)
bool(false)

------[strrpos (offest > haystack):]---------
bool(false)
bool(false)

------[strripos (empty haystack):]---------
bool(false)
bool(false)

------[strripos (empty needle):]---------
bool(false)
bool(false)

------[strripos (needle > haystack):]---------
bool(false)
bool(false)

------[strripos (offest > haystack):]---------
bool(false)
bool(false)

------[strstr (empty haystack):]---------

Warning: strstr(): Empty delimiter. in /usr/local/src/wk/39400.php on
line 72
bool(false)

Warning: mb_strstr(): Empty delimiter. in /usr/local/src/wk/39400.php
on line 73
bool(false)

------[strstr (empty needle):]---------

Warning: strstr(): Empty delimiter. in /usr/local/src/wk/39400.php on
line 76
bool(false)

Warning: mb_strstr(): Empty delimiter. in /usr/local/src/wk/39400.php
on line 77
bool(false)

------[strstr (needle > haystack):]---------
bool(false)
bool(false)

------[stristr (empty haystack):]---------

Warning: stristr(): Empty delimiter. in /usr/local/src/wk/39400.php on
line 89
bool(false)

Warning: mb_stristr(): Empty delimiter. in /usr/local/src/wk/39400.php
on line 90
bool(false)

------[stristr (empty needle):]---------

Warning: stristr(): Empty delimiter. in /usr/local/src/wk/39400.php on
line 93
bool(false)

Warning: mb_stristr(): Empty delimiter. in /usr/local/src/wk/39400.php
on line 94
bool(false)

------[stristr (needle > haystack):]---------
bool(false)
bool(false)

------[strrchr (empty haystack):]---------
bool(false)
bool(false)

------[strrchr (empty needle):]---------
bool(false)
bool(false)

------[substr_count (empty haystack):]---------

Warning: substr_count(): Empty substring. in
/usr/local/src/wk/39400.php on line 123
bool(false)

Warning: mb_substr_count(): Empty substring. in
/usr/local/src/wk/39400.php on line 124
bool(false)

------[substr_count (empty needle):]---------

Warning: substr_count(): Empty substring. in
/usr/local/src/wk/39400.php on line 127
bool(false)

Warning: mb_substr_count(): Empty substring. in
/usr/local/src/wk/39400.php on line 128
bool(false)

------[substr_count (needle > haystack):]---------
int(0)
int(0)


Thank you.


------------------------------------------------------------------------

[2006-12-03 19:59:47] maik at primacom dot net

I can confirm this. With this bugs, phpMyAdmin is also not working
correctly if func_overload of the multibyte library is used.

------------------------------------------------------------------------

[2006-11-17 02:50:44] michael at labuschke dot de

same on linux

------------------------------------------------------------------------

[2006-11-07 14:30:24] [EMAIL PROTECTED]

Assigned to maintainer

------------------------------------------------------------------------

[2006-11-06 15:47:54] christoph at ziegenberg dot de

Point "different behaviour between a function and the case-insensitive
version" isn't right, I meant the difference between stripos() and
strripos() (which behave equal in the mbstring version).

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/39400

-- 
Edit this bug report at http://bugs.php.net/?id=39400&edit=1

Reply via email to