|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-21 17:58 UTC] markskilbeck@php.net
-Status: Open
+Status: Bogus
[2010-09-21 17:58 UTC] markskilbeck@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Jan 23 09:00:01 2026 UTC |
Description: ------------ The documentation for functions like str_replace says, that you can use an array as subject. Multidimensional arrays are not excluded, but if you use them nothing happens. This bug is reproducable with ALL functions which should support the use of array. If this is wanted behaviour you should edit the documentation. Test script: --------------- $testarray = array(array('bla', 'blub'),array('blub', 'bla')); $testarray = str_replace('bla', 'blub', $testarray); //doesn't work print_r($testarray); echo('<br>'); for($i=0; $i<count($testarray); $i++) { $testarray[$i] = str_replace('bla', 'blub', $testarray[$i]); //works } print_r($testarray); Expected result: ---------------- -only array output of 'blub' Actual result: -------------- Array ( [0] => Array ( [0] => bla [1] => blub ) [1] => Array ( [0] => blub [1] => bla ) ) Array ( [0] => Array ( [0] => blub [1] => blub ) [1] => Array ( [0] => blub [1] => blub ) )