|  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
 [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 16:01:38 2024 UTC