|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2008-04-02 10:03 UTC] julian dot hartmann at gmail dot com
 Description: ------------ Error in description of second paramter for trim in german documentation. http://www.php.net/manual/de/function.trim.php The second parameter (charlist) is explained as being a list of ADDITIONAL characters to remove, but trim() seems to replace its default list with this one instead of extending it. English documentation does state not whether the second param "adds to" or "replaces" the default. Reproduce code: --------------- $foo = " \xa0 bar"; $trimmed = trim($foo, "\xa0"); var_dump($trimmed); $trimmed = trim($foo, "\xa0\x20"); var_dump($trimmed); Expected result: ---------------- string(3) "bar" string(3) "bar" Actual result: -------------- string(6) " bar" string(3) "bar" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 11:00:01 2025 UTC | 
The german wording states "Optional kann eine Liste weiterer Zeichen angef?gt werden" which translates pretty much to "optionally, a list of additional characters can be attached" ("weiterer" = additional; "angef?gt" = attached). "Er enth?lt eine Liste aller zu entfernenden Zeichen." could be read as stating it correctly, but then it would still contradict the first sentence. I would recommend to alter the first sentence to a wording like "Optional kann die Liste der Zeichen angegeben werden, die an Anfang und Ende der Zeichenkette entfernt werden sollen." (= "Optionally, the list of characters can be specified which will be removed from the beginning and the end of the string."). This would at least implicitly state that the default list will be replaced. This would pretty much resemble the english wording, despite none of them explicitly states that the default list will be replaced by the second parameter.This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Agreed. Once you place the sentences side-by-side, the updated text is better. Thanks for your submission! ~ Dan