#31301 [NEW]: trim() does not trim single whitespace variables

From: Date: Sun, 26 Dec 2004 06:36:58 +0000
Subject: #31301 [NEW]: trim() does not trim single whitespace variables
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71069@lists.php.net to get a copy of this message
From: aitrus at tresgeek dot net Operating system: RHEL 3 (u4) PHP version: 4.3.10 PHP Bug Type: Strings related Bug description: trim() does not trim single whitespace variables Description: ------------ When passed a string variable with a single space as its contents, trim() returns a variable with a single space as its contents. Reproduce code: --------------- $foo = " "; $foo = trim( $foo ); echo "x{$foo}x"; -- output is: 'x x' Expected result: ---------------- trim() should return a empty string (or false). -- Edit bug report at http://bugs.php.net/?id=31301&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31301&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31301&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31301&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31301&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31301&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31301&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31301&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31301&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31301&r=support Expected behavior: http://bugs.php.net/fix.php?id=31301&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31301&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31301&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31301&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31301&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31301&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31301&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31301&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31301&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31301&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31301&r=mysqlcfg

« previous php.bugs (#71069) next »