]> granicus.if.org Git - php/commit
Fixed bug #75902
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 10 Mar 2020 15:49:17 +0000 (16:49 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 10 Mar 2020 15:49:17 +0000 (16:49 +0100)
commite8678fcb42c5cb1ea38ff9c6819baca74c2bb5ea
treefb297a252a7b6198a6c06277eb3251bc33b08508
parentd9219f997df2e5852f76e04767baaca4acf729e7
Fixed bug #75902

Don't special-case nested arrays/objects in str_replace(), instead
perform a string cast on them as well. For arrays, this will always
result in the usual conversion warning.

This behavior is consistent with preg_replace(). If we didn't want
to cast the array to string here, we should instead perform the
replacement recursively. Silently copying it is just confusing.
NEWS
ext/standard/string.c
ext/standard/tests/strings/bug25671.phpt
ext/standard/tests/strings/bug71969.phpt
ext/standard/tests/strings/str_replace_variation1.phpt