#46242 [Opn->Bgs]: Ltrim-Rtrim Palindrome Syndrome

From: Date: Mon, 06 Oct 2008 15:49:27 +0000
Subject: #46242 [Opn->Bgs]: Ltrim-Rtrim Palindrome Syndrome
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129512@lists.php.net to get a copy of this message
ID: 46242 Updated by: bjori@php.net Reported By: can at berkol dot net -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Windows Vista PHP Version: 5.2.6 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 Previous Comments: ------------------------------------------------------------------------ [2008-10-06 15:16:56] can at berkol dot net ignore syntax error .... I made mistakes during copying and pasting from one textbx to another... ------------------------------------------------------------------------ [2008-10-06 15:15:50] can at berkol dot net Description: ------------ Maybe there is a reasoning beyond this. However, unexpected output is produced with ltrim and rtrim if the string has a palindrome-'like' structure. Reproduce code: --------------- $str = 'daobcd'; echo ltrim($str, 'dao') $str = 'daoabc'; echo ltrim($str, 'dao') / $str = 'bcsedeo'; echo rtrim($str, 'deo'); Expected result: ---------------- 1. bcd 2. abc 3. bcse Actual result: -------------- 1. bcd 2. bc 3. bcs ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46242&edit=1

« previous php.bugs (#129512) next »