ID:               31301
 Updated by:       [EMAIL PROTECTED]
 Reported By:      aitrus at tresgeek dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: Linux
 PHP Version:      4.3.10
 New Comment:

Still not a bug :)
  gets converted not to a space (ascii 32) but to a non breaking
space, which matches to ascii 160. And that character is not always a
non breaking space in every character set so trim() should not trim it
by default.


Previous Comments:
------------------------------------------------------------------------

[2004-12-26 18:34:37] aitrus at tresgeek dot net

I apologize, my example was too simple and did not reproduce the
problem:

$foo = " ";

$foo = html_entity_decode( $foo, ENT_QUOTES );
$foo = trim( $foo );

echo "x{$foo}x";

output is:  'x x'

------------------------------------------------------------------------

[2004-12-26 11:34:12] [EMAIL PROTECTED]

Works fine here:
[EMAIL PROTECTED]:~$ cat bug31301.php
<?php
$foo = " ";

$foo = trim( $foo );

echo "x{$foo}x";
?>

[EMAIL PROTECTED]:~$ php-4.3dev bug31301.php
xx

------------------------------------------------------------------------

[2004-12-26 07:44:34] aitrus at tresgeek dot net

updated OS

------------------------------------------------------------------------

[2004-12-26 07:36:57] aitrus at tresgeek dot net

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 this bug report at http://bugs.php.net/?id=31301&edit=1

Reply via email to