|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-10-13 04:23 UTC] requinix@php.net
-Summary: Trim function with a charlist that includes tab "\t"
removes t char
+Summary: Trim function with a charlist that includes tab '\t'
removes t char
-Status: Open
+Status: Not a bug
-Package: *General Issues
+Package: Strings related
[2015-10-13 04:23 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 17:00:01 2025 UTC |
Description: ------------ Noticed an odd behavior whereby a PHP trim function which includes the "\t" as an optional charlist entry will strip the character "t" from the string if it happens to be the last char. Test script: --------------- $returnValue = trim('someurl.net', '\\t'); $returnValue = "someurl.ne" or $returnValue = trim('someurl.net', ' \t\n\r\0\x0B/'); $returnValue = "someurl.ne" however this is fine ... $returnValue = trim('someurl.netx', '\t'); $returnValue = "someurl.netx" Expected result: ---------------- I did not expect that my url's .net domain would "lose" its ending "t" char as a result of performing a trim that included the tab "\t" entry within its char list.