|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13866 strtok() parses erroneously empty substrings - PHP 4.0.7RC2
Submitted: 2001-10-29 17:32 UTC Modified: 2001-11-02 14:21 UTC
From: rcpj at panix dot com Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
 [2001-10-29 17:32 UTC] rcpj at panix dot com
NOTE, the PHP version is reported as 4.0.7RC2 but that's not in the predefined list on the form.

The function strtok() misparses strings where some fields are empty, such as #1 and #4 in the list below, 

1|carrot||(no adjective)
4|tomato||(no adjective)

Compare the output of the test program (the code is listed below) running (under PHP 4.0.7RC2) at: 

versus the same program (under PHP 4.0.3pl1) at: 

Both the Apache module and the CGI version in /usr/local/bin/php are affected.

============== test-module.php =============


for ($i=0; $i<count($Item);$i++)

     print("$Type $Name: line #$Number $Comment<br>\n");



I am not in charge of program maintenance on either system, but I am the webmaster for several sites there. I was encouraged by the administrator of the machine on which is located to report this myself.


Pierre Jelenc


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-02 14:21 UTC]
fixed in CVS
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 21:01:27 2023 UTC