|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66225 strtok incorrectly parses string
Submitted: 2013-12-03 11:09 UTC Modified: 2013-12-03 12:44 UTC
From: nick dot chervyakov at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nick dot chervyakov at gmail dot com
New email:
PHP Version: OS:


 [2013-12-03 11:09 UTC] nick dot chervyakov at gmail dot com
strtok cuts repeatable characters which are not in the separator.

Test script:

$str = "hello melon";

echo strtok($str, 'lo') . "\n";
echo strtok('lo');

Expected result:

Actual result:

// as if the first separator is 'llo'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-03 12:44 UTC]
-Status: Open +Status: Not a bug -Operating System: windows7, ubuntu-64 +Operating System:
 [2013-12-03 12:44 UTC]
Quote from manual: "delimited by any character from token. "
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 29 20:01:30 2024 UTC