php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72297 Trim not work as expected.
Submitted: 2016-05-30 22:43 UTC Modified: 2016-05-31 03:06 UTC
From: levaconline at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: PHP 7.0.5 (cli) (built: Mar 29 2016 18:07:10) ( NTS ) OS: Arch linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: levaconline at gmail dot com
New email:
PHP Version: OS:

 

 [2016-05-30 22:43 UTC] levaconline at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.trim
---
This looks like bug in trim function:
------------------------------------------

$name = "File_Manager_Remote.en";

$name = trim($name, '.en');

echo  $name;
------------------------------------------

Result: File_Manager_Remot

Expected result is: File_Manager_Remote
Trim removes one more unexpected character.


Test script:
---------------
$name = "File_Manager_Remote.en";

$name = trim($name, '.en');

echo  $name;


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-30 22:46 UTC] levaconline at gmail dot com
-Summary: PHP 7.0.5 (cli) (built: Mar 29 2016 18:07:10) ( NTS ) . Not listed in dropdown +Summary: Trim not work as expected. -PHP Version: 7.0Git-2016-05-30 (snap) +PHP Version: PHP 7.0.5 (cli) (built: Mar 29 2016 18:07:10) ( NTS )
 [2016-05-30 22:46 UTC] levaconline at gmail dot com
Summary improved
 [2016-05-31 03:06 UTC] laruence@php.net
-Status: Open +Status: Not a bug
 [2016-05-31 03:06 UTC] laruence@php.net
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

".en" means remove any . , e, and n
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 23:01:24 2019 UTC