Doc #64081 [Opn]: Trim can return false
Edit report at https://bugs.php.net/bug.php?id=64081&edit=1
ID: 64081
User updated by: blueAlien86 at gmail dot com
Reported by: blueAlien86 at gmail dot com
Summary: Trim can return false
Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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
value.
According to the empty function, if an empty string is passed to trim, it will
return FALSE.
Previous Comments:
------------------------------------------------------------------------
[2013-01-26 10:27:01] krakjoe@php.net
Can you please clarify the bug you are reporting ?
------------------------------------------------------------------------
[2013-01-26 09:59:05] blueAlien86 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.trim#refsect1-function.trim-
returnvalues
---
Taken from Empty function documentation:
will not work: empty(trim($name)). Instead, use trim($name) == false.
Test script:
---------------
unset($name);
echo empty(trim($name)); //FAILS
echo trim($name); //FALSE
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64081&edit=1
Thread (4 messages)