Bug #2272: implode() glues string to one-element-arrays

From: Date: Thu, 09 Sep 1999 18:25:08 +0000
Subject: Bug #2272: implode() glues string to one-element-arrays
Groups: php.dev 
Request: Send a blank email to php-dev+get-10777@lists.php.net to get a copy of this message
From: skra0063@rz.uni-hildesheim.de Operating system: Solaris 5.7 PHP version: 3.0.12 PHP Bug Type: Feature/Change Request Bug description: implode() glues string to one-element-arrays if you use the implode()-function on an array with only one element in it, the glue string is appended to the name of the only element, anyway. i could not think of any situation where this could be helpful since the glue string is not appended to the last element of a more-that-one-element-array, either. i, for example, use it to build a mysql-query where the glue string is "or (row-name)="; of course, mysql reports an error if it encounters something like "...=" with nothing behind the "=". sure, one can easily work around this with an if-construct, but i think it would make more sense if, in the case described, the glue string were not appeneded to the result.

« previous php.dev (#10777) next »