facebook/hhvm — pull request #1383 by bdurette (2013-12-19 03:17:30+00:00)
Title: str_replace counts fail to accumulate when passed array(s).

The $count parameter of str_replace is supposed to return the total number of string replacements performed. This was only working correctly when both $search and $subject were strings. When either or both are arrays, the counts need to accumulate across all replacements. The code, as written, was only returning the replacement count for the last pair of values.