API / Minn\Support / SearchReplace

SearchReplace final class

Minn\Support\SearchReplace · public/minn/src/Minn/Support/SearchReplace.php · 38 lines

String replace that walks serialized-PHP arrays of scalars without unserialize, so a domain change in an option blob keeps its lengths.

Public

staticin(string $value, string $old, string $new): array#

A value with one string replaced, and how many times.

@return array{0: string, 1: int} replacement and how many times $old occurred

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatewalk(mixed $value, string $old, string $new, int $count): mixed#