#33113 [Opn->Bgs]: Evaluating trim trim on an array kills it
| From: | tony2001@php.net | Date: | Mon, 23 May 2005 20:55:43 +0000 |
| Subject: | #33113 [Opn->Bgs]: Evaluating trim trim on an array kills it | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79408@lists.php.net to get a copy of this message | ||
ID: 33113
Updated by: tony2001@php.net
Reported By: c dot herzog at chsoftware dot net
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: XP
PHP Version: 4.3.10
New Comment:
There IS error:
Notice: Array to string conversion in ...
just turn display_errors On and set error_reporting to E_ALL.
Previous Comments:
------------------------------------------------------------------------
[2005-05-23 22:53:02] c dot herzog at chsoftware dot net
Description:
------------
When you use a trim by mistake on an array, the array get's an string
Reproduce code:
---------------
settype($asd,"array");
$asd["a"] = "one";
$asd["b"] = "two";
$asd["c"] = "three";
echo gettype($asd); //-> array
print_r($asd); //gets back the array
$asd = trim($asd); //trim it
print_r($asd); //prints Array
echo gettype($asd);//gives string back
Expected result:
----------------
There should be an error, because a trim function can't be use to an
array, or every offset should get trimmed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33113&edit=1