Re: CVS update: php3/functions

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: CVS update: php3/functions
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-1575@lists.php.net to get a copy of this message
> 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@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1575) next »