Bug #14541 Updated: strtok broken again
| From: | mfischer@php.net | Date: | Sun, 16 Dec 2001 10:44:55 +0000 |
| Subject: | Bug #14541 Updated: strtok broken again | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-73992@lists.php.net to get a copy of this message | ||
ID: 14541
Updated by: mfischer
Reported By: mlemos@acm.org
Status: Bogus
Bug Type: Strings related
Operating System: Any
PHP Version: 4.1.0
New Comment:
Documention is now fixed in CVS, thx 2 derick.
Previous Comments:
------------------------------------------------------------------------
[2001-12-16 04:45:08] derick@php.net
jmoore did not break this, he fixed a faulty behavior that existed since 4.0.0.
The current behavior is the correct one, as outlined by every unix or windows manual about the topic
'strtok'.
Derick
------------------------------------------------------------------------
[2001-12-16 02:40:29] mlemos@acm.org
I understand that it is very hard to make developers write tests for new software, but at least
those that commit bug fixes should be required to submit test scripts that reproduce the bugs if
they do not exist yet.
As for myself, I always present test cases when they are possible in the bug report itself, just
like I did for this. So, developers have at least half of the job done.
I think that is a matter of making it a rule by adding to the CODING_STANDARDS.
------------------------------------------------------------------------
[2001-12-16 02:25:53] zak@php.net
While we could try to force developers to write tests
before they commit code (heck, MySQL does it), but we
might not have much luck. :)
I think that we should look to the QA team (and interested
individuals such as yourself) to start writing tests.
I am working on tests for the array functions right now
(coincidentally, before I commit a whack of changes to the
array functions. :)
In Frankfurt, Rasmus suggested that we develop a web-based
interface for developing tests as a way to lower the
barrier for writing tests. We could look at doing this.
------------------------------------------------------------------------
[2001-12-16 02:15:52] mlemos@acm.org
It seems that strtok function is broken again.
The following script returns:
<?
$first_token=strtok("/something","/");
$second_token=strtok("/");
var_dump($first_token,$second_token);
?>
Should output as always (at least until PHP 4.0.6 it does):
string(0) ""
string(9) "something"
But it outputs:
string(9) "something"
bool(false)
It seems that jmoore broken in when he tried to fix this bug:
http://bugs.php.net/bug.php?id=13866
I think that no developer should be allowed to fix bugs before:
1) submit a test case to leave in the tests directory
2) Verify that his fixes do not make his and others tests fail.
Until this procedure becomes mandatory, we'll keep seeing a history of illness in functions
like strtok that seems to never end.
This is what regressive tests are for. Zak, please help here! :-)
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14541&edit=1