ID: 43642 Updated by: [EMAIL PROTECTED] Reported By: kampde at gmail dot com -Status: Open +Status: Bogus Bug Type: Performance problem Operating System: debian etch PHP Version: 5.2.5 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2007-12-20 12:05:33] kampde at gmail dot com Description: ------------ In str_replace(), if you put as a replace string a call to a function (that returns a string), this call is executed always, even if the text to be replaced is not found in the text. Reproduce code: --------------- function some_func() { echo "some_func() was called!\n"; return 'bar'; } echo str_replace('foo', some_func(), "aaaaa"); Expected result: ---------------- aaaa Actual result: -------------- some_func() was called! aaaa ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43642&edit=1