1--TEST-- 2Bug #71969 (str_replace returns an incorrect resulting array after a foreach by reference) 3--FILE-- 4<?php 5$a = array( 6 array("one" => array("a"=>"0000", "b"=>"1111")), 7); 8 9//foreach by reference, changing the array value 10foreach($a as &$record) 11{ 12 $record["one"]["a"] = "2222"; 13} 14var_dump(str_replace("2", "3", $a)); 15?> 16--EXPECTF-- 17Warning: Array to string conversion in %s on line %d 18array(1) { 19 [0]=> 20 string(5) "Array" 21} 22