src/Gobie/Regex/Wrappers/Mb/MbRegex.php
public static function split($pattern, $subject, $option = '', $limit = -1)
    {
        static::setUp($pattern);

        $position     = 0;
        $lastPosition = 0;
        $res          = array();
        $subjectLen   = \mb_strlen($subject);

        do {
            \mb_ereg_search_init($subject, $pattern, $option);
            \mb_ereg_search_setpos($position);

            $matches = \mb_ereg_search_regs();
            if ($matches === false) {
                break;
            }

            $position     = \mb_ereg_search_getpos();
            $res[]        = \mb_substr($subject, $lastPosition, $position - \mb_strlen($matches[0]) - $lastPosition);
            $lastPosition = $position;
        } while ($position < $subjectLen && --$limit !== 1);

        if ($lastPosition <= $subjectLen) {
            $res[] = \mb_substr($subject, $lastPosition);
        }

        static::tearDown();

        return $res;
    }
public static function split($pattern, $subject, $option = '', $limit = -1)
    {
        static::setUp($pattern);

        $position     = 0;
        $lastPosition = 0;
        $res          = array();
        $subjectLen   = \mb_strlen($subject);

        do {
            \mb_ereg_search_init($subject, $pattern, $option);
            \mb_ereg_search_setpos($position);

            $matches = \mb_ereg_search_regs();
            if ($matches === false) {
                break;
            }

            $position     = \mb_ereg_search_getpos();
            $res[]        = \mb_substr($subject, $lastPosition, $position - \mb_strlen($matches[0]) - $lastPosition);
            $lastPosition = $position;
        } while ($position < $subjectLen && --$limit !== 1);

        if ($lastPosition <= $subjectLen) {
            $res[] = \mb_substr($subject, $lastPosition);
        }

        static::tearDown();

        return $res;
    }
Regular expression split and return all parts.

@param string $pattern Pattern
@param string $subject Subject
@param int    $limit   Limit
@param string $option  Option
@return string[] Array of split parts, array with original string otherwise
@throws MbRegexException When compilation error occurs
@link http://php.net/function.mb-split.php