Bug #66225 [Opn->Nab]: strtok incorrectly parses string
| From: | mike@php.net | Date: | Tue, 03 Dec 2013 12:44:43 +0000 |
| Subject: | Bug #66225 [Opn->Nab]: strtok incorrectly parses string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183099@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66225&edit=1
ID: 66225
Updated by: mike@php.net
Reported by: nick dot chervyakov at gmail dot com
Summary: strtok incorrectly parses string
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
-Operating System: windows7, ubuntu-64
+Operating System:
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Quote from manual: "delimited by any character from token. "
Previous Comments:
------------------------------------------------------------------------
[2013-12-03 11:09:13] nick dot chervyakov at gmail dot com
Description:
------------
strtok cuts repeatable characters which are not in the separator.
Test script:
---------------
<?php
$str = "hello melon";
echo strtok($str, 'lo') . "\n";
echo strtok('lo');
Expected result:
----------------
hel
me
Actual result:
--------------
he
me
// as if the first separator is 'llo'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66225&edit=1