|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-12-20 14:37 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 04:00:02 2025 UTC |
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