#31302 [NEW]: empty() shouldn't count ' ', '\n', etc
| From: | aitrus at tresgeek dot net | Date: | Sun, 26 Dec 2004 06:43:20 +0000 |
| Subject: | #31302 [NEW]: empty() shouldn't count ' ', '\n', etc | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-71070@lists.php.net to get a copy of this message | ||
From: aitrus at tresgeek dot net
Operating system:
PHP version: 4.3.10
PHP Bug Type: Feature/Change Request
Bug description: empty() shouldn't count ' ', '\n', etc
Description:
------------
I thought that this used to be the behavior of empty()...
It would be nice of empty() returned true when passed a string which only
had spaces, tabs, or newline characters in it.
Reproduce code:
---------------
$foo = ' ';
if ( empty( $foo ) ) {
echo "foo is empty";
} else {
echo "foo is NOT empty";
}//if
---
output is: 'foo is NOT empty'
Expected result:
----------------
expected output: 'foo is empty'
--
Edit bug report at http://bugs.php.net/?id=31302&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31302&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31302&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31302&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31302&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31302&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31302&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31302&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31302&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31302&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31302&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=31302&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=31302&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31302&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31302&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31302&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31302&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31302&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31302&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31302&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31302&r=mysqlcfg