public function splitString($string)
    {
        if ($this->digits->hasStringConflict()) {
            throw new \RuntimeException('The number base does not support string presentation');
        }

        $pattern = $this->getDigitPattern();

        if ((string) $string === '') {
            $digits = [];
        } elseif (is_int($pattern)) {
            $digits = str_split($string, $this->digitPattern);
        } else {
            preg_match_all($pattern, $string, $match);
            $digits = $match[0];
        }

        return $this->canonizeDigits($digits);
    }
public function splitString($string)
    {
        if ($this->digits->hasStringConflict()) {
            throw new \RuntimeException('The number base does not support string presentation');
        }

        $pattern = $this->getDigitPattern();

        if ((string) $string === '') {
            $digits = [];
        } elseif (is_int($pattern)) {
            $digits = str_split($string, $this->digitPattern);
        } else {
            preg_match_all($pattern, $string, $match);
            $digits = $match[0];
        }

        return $this->canonizeDigits($digits);
    }
public function splitString ( $ string ) { if ( $ this -> digits -> hasStringConflict ( ) ) { throw new \ RuntimeException ( 'The number base does not support string presentation' ) ; } $ pattern = $ this -> getDigitPattern ( ) ; if ( ( string ) $ string === '' ) { $ digits = [ ] ; } elseif ( is_int ( $ pattern ) ) { $ digits = str_split ( $ string , $ this -> digitPattern ) ; } else { preg_match_all ( $ pattern , $ string , $ match ) ; $ digits = $ match [ 0 ] ; } return $ this -> canonizeDigits ( $ digits ) ; }
Splits number string into individual digits.
@param string $string String to split into array of digits
@return array Array of digits
@throws \RuntimeException If numeral system does not support strings
Splits number string into individual digits .