Bug #70705 [Opn->Nab]: Trim function with a charlist that includes tab '\t' removes t char

From: Date: Tue, 13 Oct 2015 04:24:00 +0000
Subject: Bug #70705 [Opn->Nab]: Trim function with a charlist that includes tab '\t' removes t char
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196588@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70705&edit=1 ID: 70705 Updated by: requinix@php.net Reported by: joshisa at us dot ibm dot com -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 Type: Bug -Package: *General Issues +Package: Strings related Operating System: N/A PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php http://php.net/manual/en/language.types.string.php Previous Comments: ------------------------------------------------------------------------ [2015-10-13 04:12:32] joshisa at us dot ibm dot com 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70705&edit=1

« previous php.bugs (#196588) next »