diff --git a/README.md b/README.md index 71b8990..15a2334 100644 --- a/README.md +++ b/README.md @@ -622,8 +622,9 @@ s('bàř')->prepend('fòô'); // 'fòôbàř' Replaces all occurrences of $pattern in $str by $replacement. An alias for mb_ereg_replace(). Note that the 'i' option with multibyte patterns -in mb_ereg_replace() requires PHP 5.4+. This is due to a lack of support -in the bundled version of Oniguruma in PHP 5.3. +in mb_ereg_replace() requires PHP 5.6+ for correct results. This is due +to a lack of support in the bundled version of Oniguruma in PHP < 5.6, +and current versions of HHVM (3.8 and below). ```php s('fòô ')->regexReplace('f[òô]+\s', 'bàř', 'msr'); // 'bàř' diff --git a/src/Stringy.php b/src/Stringy.php index ea44539..4a3fbe9 100644 --- a/src/Stringy.php +++ b/src/Stringy.php @@ -943,8 +943,9 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess /** * Replaces all occurrences of $pattern in $str by $replacement. An alias * for mb_ereg_replace(). Note that the 'i' option with multibyte patterns - * in mb_ereg_replace() requires PHP 5.4+. This is due to a lack of support - * in the bundled version of Oniguruma in PHP 5.3. + * in mb_ereg_replace() requires PHP 5.6+ for correct results. This is due + * to a lack of support in the bundled version of Oniguruma in PHP < 5.6, + * and current versions of HHVM (3.8 and below). * * @param string $pattern The regular expression pattern * @param string $replacement The string to replace with @@ -1183,7 +1184,8 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess return array(); } - // mb_split errors when supplied an empty pattern in PHP 5.3 + // mb_split errors when supplied an empty pattern in < PHP 5.4.13 + // and current versions of HHVM (3.8 and below) if ($pattern === '') { return array(static::create($this->str, $this->encoding)); }