php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72079 Trim error on www.
Submitted: 2016-04-22 17:10 UTC Modified: 2016-04-22 17:20 UTC
From: filipeandre07 at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.5.34 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: filipeandre07 at gmail dot com
New email:
PHP Version: OS:

 

 [2016-04-22 17:10 UTC] filipeandre07 at gmail dot com
Description:
------------
Trim function has error on www.w pattern.


Test script:
---------------
$a = trim('www.worten.pt','www.');
echo $a;

result: orten.pt

Expected result:
----------------
worten.pt

Actual result:
--------------
orten.pt

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-22 17:20 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2016-04-22 17:20 UTC] requinix@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

trim removes individual characters, not strings. trimming "www." is the same as trimming "w." and will remove any 'w's or '.'s at the beginning or end.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 08:00:02 2026 UTC