ID: 39361
Updated by: masugata@php.net
-Reported By: s dot masugata at mbg dot nifty dot com
+Reported By: s dot masugata at digicom dot dnp dot co dot jp
-Status: Feedback
+Status: Closed
Bug Type: mbstring related
Operating System: Win XP SP 2
PHP Version: 5.2.0
Assigned To: masugata
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Thank you for test. :)
Previous Comments:
------------------------------------------------------------------------
[2006-12-21 18:15:04] christoph at ziegenberg dot de
The example I posted works fine now (Win XP SP2).
Thanks!
------------------------------------------------------------------------
[2006-12-21 18:02:47] masugata@php.net
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-09 17:59:33] christoph at ziegenberg dot de
You can download an example here:
http://www.ziegenberg.de/phpbug_39361.zip
------------------------------------------------------------------------
[2006-12-09 16:12:34] iliaa@php.net
There was no fix, the bug was accidentally closed. So far I've
not been able to replicate the bug.
------------------------------------------------------------------------
[2006-12-09 11:20:40] seanius at debian dot org
hi,
we've had a report about this in the debian bug tracking system:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399924
and possibly
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401525
the bug report says that it's been fixed in CVS, but then there's a
rather ambiguous "still need to look into this" message afterwards and
the bug is still in state: assigned.
as debian will be freezing really, really soon if there's a fix for
this i'd really like to see it so i can backport it to the 5.2.0
packages that are going to ship with the next stable release.
thanks!
------------------------------------------------------------------------
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/39361
--
Edit this bug report at http://bugs.php.net/?id=39361&edit=1