Bug #10475 Updated: Array returned by str_replace unusable.
| From: | andrei@php.net | Date: | Tue, 24 Apr 2001 17:08:18 +0000 |
| Subject: | Bug #10475 Updated: Array returned by str_replace unusable. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52293@lists.php.net to get a copy of this message | ||
ID: 10475
Updated by: andrei
Reported By: sbw@sbw.org
Old-Status: Open
Status: Closed
Bug Type: *Function Specific
PHP Version: 4.0.4pl1
Assigned To:
Comments:
It works in latest CVS.
$input = array('foobar', 'barhop');
var_dump(implode(' : ', str_replace('bar', '---', $input)));
Output:
string(15) "foo--- : ---hop"
Previous Comments:
---------------------------------------------------------------------------
[2001-04-24 13:06:09] sbw@sbw.org
See http://sbw.sbw.org/str_replace/.
str_replace(-string-, -string-, -array-) should return an array.
It appears that it does so, but when the returned array is passed to implode or each, PHP issues
warnings:
"Bad arguments to implode()"
"Variable passed to each() is not an array or object"
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10475&edit=2