#33113 [NEW]: Evaluating trim trim on an array kills it
| From: | c dot herzog at chsoftware dot net | Date: | Mon, 23 May 2005 20:53:02 +0000 |
| Subject: | #33113 [NEW]: Evaluating trim trim on an array kills it | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-79407@lists.php.net to get a copy of this message | ||
From: c dot herzog at chsoftware dot net
Operating system: XP
PHP version: 4.3.10
PHP Bug Type: Arrays related
Bug description: Evaluating trim trim on an array kills it
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 bug report at http://bugs.php.net/?id=33113&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33113&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33113&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33113&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33113&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33113&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33113&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33113&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33113&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33113&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33113&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33113&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33113&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33113&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33113&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33113&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33113&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33113&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33113&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33113&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33113&r=mysqlcfg