@b4n said:
if the replacement contains the search term, it'll be replaced recursively forever (infinite loop + steady memory growth).
@xiota said:
replace_all searches for needle starting from the beginning of haystack. If replacement contains needle, the result is an infinite loop.
Those seem to say the same to me, and "infinite loop" (at least until it runs out of memory :-) sounds like the issue, sounds like furious agreement :-D