#46242 [Opn]: Ltrim-Rtrim Palindrome Syndrome
ID: 46242
User updated by: can at berkol dot net
Reported By: can at berkol dot net
Status: Open
Bug Type: *General Issues
Operating System: Windows Vista
PHP Version: 5.2.6
New Comment:
ignore syntax error .... I made mistakes during copying and pasting
from one textbx to another...
Previous Comments:
------------------------------------------------------------------------
[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
Thread (3 messages)