Date: 09/30/98
- Next message: thies <email protected>: "[PHP-DEV] Bug #801: cannot use the dir() function inside classes"
- Previous message: Rasmus Lerdorf: "Re: [PHP-DEV] cannot close bug reports?"
- In reply to: shane: "[PHP-DEV] CVS update: php3/functions"
- Next in thread: Shane Caraveo: "Re: [PHP-DEV] CVS update: php3/functions"
- Reply: Shane Caraveo: "Re: [PHP-DEV] CVS update: php3/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Fix for bug #800
I don't agree with this fix. You have just made strtok() completely
non-standard. strtok() has never ignored multiple adjacent tokens, and I
don't think it should. The C equivalent function certainly doesn't do
this.
If you have:
$a="a b";
And you tokenize on " " (a space) then you should get:
"a"
""
"b"
when you go through the string. Bug report #800 is bogus because the
loops relies on the result of the strtok() to be true in order for it to
continue. If you have two adjacent tokens then you are correctly going to
get a null string as the strtok() result.
If someone doesn't want this behaviour, then they should compact their
string before running strtok on it. Something like:
$new = ereg_replace(" +"," ",$string);
Chances are the user should be using explode() anyway though.
-Rasmus
-- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe <email protected> For help: php-dev-help <email protected>
- Next message: thies <email protected>: "[PHP-DEV] Bug #801: cannot use the dir() function inside classes"
- Previous message: Rasmus Lerdorf: "Re: [PHP-DEV] cannot close bug reports?"
- In reply to: shane: "[PHP-DEV] CVS update: php3/functions"
- Next in thread: Shane Caraveo: "Re: [PHP-DEV] CVS update: php3/functions"
- Reply: Shane Caraveo: "Re: [PHP-DEV] CVS update: php3/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

