|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64081 Trim can return false
Submitted: 2013-01-26 09:59 UTC Modified: 2013-01-26 10:38 UTC
From: blueAlien86 at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: blueAlien86 at gmail dot com
New email:
PHP Version: OS:


 [2013-01-26 09:59 UTC] blueAlien86 at gmail dot com
From manual page:

Taken from Empty function documentation:
will not work: empty(trim($name)). Instead, use trim($name) == false.

Test script:
echo empty(trim($name)); //FAILS
echo trim($name); //FALSE


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-26 10:27 UTC]
Can you please clarify the bug you are reporting ?
 [2013-01-26 10:30 UTC] blueAlien86 at gmail dot com
In the documentation for the trim function under return values, only a string is 
listed. I am requesting that FALSE also be added to the documentation as a return 
According to the empty function, if an empty string is passed to trim, it will 
return FALSE.
 [2013-01-26 10:38 UTC]
False is not returned in the example you gave.

$name = "test";


 [2013-01-26 10:38 UTC]
-Status: Open +Status: Not a bug
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Apr 15 11:01:24 2021 UTC