ID: 43809
Updated by: [EMAIL PROTECTED]
Reported By: admin at ifyouwantblood dot de
Status: Open
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 5.2.5
New Comment:
Looks fine to me. My try:
Index: string.c
===================================================================
RCS file: /repository/php-src/ext/standard/string.c,v
retrieving revision 1.445.2.14.2.69.2.8
diff -u -r1.445.2.14.2.69.2.8 string.c
--- string.c 31 Dec 2007 07:17:15 -0000 1.445.2.14.2.69.2.8
+++ string.c 11 Jan 2008 00:00:34 -0000
@@ -1264,7 +1264,7 @@
}
}
- if (p - BG(strtok_last)) {
+ if ((skipped || BG(strtok_len) != strlen(BG(strtok_last))) && p
- BG(strtok_last)) {
return_token:
RETVAL_STRINGL(BG(strtok_last) + skipped, (p -
BG(strtok_last)) - skipped, 1);
BG(strtok_last) = p + 1;
Previous Comments:
------------------------------------------------------------------------
[2008-01-10 19:06:45] admin at ifyouwantblood dot de
Description:
------------
In PHP 4.1 strtok() has been changed to return FALSE if a repeated
token wasnt found in the haystack string. It should also return FALSE if
needle wasnt found at first place.
Reproduce code:
---------------
<?php
$something=strtok('something',':');
var_dump($something);
?>
Expected result:
----------------
bool(false)
Actual result:
--------------
string(9) "something"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43809&edit=1