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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC