php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33113 Evaluating trim trim on an array kills it
Submitted: 2005-05-23 22:53 UTC Modified: 2005-05-23 22:55 UTC
From: c dot herzog at chsoftware dot net Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.3.10 OS: XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: c dot herzog at chsoftware dot net
New email:
PHP Version: OS:

 

 [2005-05-23 22:53 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-23 22:55 UTC] tony2001@php.net
There IS error:
Notice: Array to string conversion in ...
just turn display_errors On and set error_reporting to E_ALL.
 [2013-09-03 08:34 UTC] daverandom@php.net
Automatic comment from SVN on behalf of daverandom
Revision: http://svn.php.net/viewvc/?view=revision&revision=331274
Log: Typo fix in newt

---
Supplied by Anonymous #33113
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC