1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-12 08:14:06 +02:00

Fix split for PHP 5.3

This commit is contained in:
Daniel St. Jules
2015-07-26 23:49:50 -07:00
parent f34af92850
commit a39ed63627

View File

@@ -1183,6 +1183,11 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
return array();
}
// mb_split errors when supplied an empty pattern in PHP 5.3
if ($pattern === '') {
return array(static::create($this->str, $this->encoding));
}
$regexEncoding = mb_regex_encoding();
mb_regex_encoding($this->encoding);