public function explode($delimiter): array
    {
        Assert::typeOf(['string', __CLASS__], $delimiter);

        $response = [];
        $results  = explode((string) $delimiter, $this->data);

        if ($results === false) {
            throw new RuntimeException('An unknown error occurred while splitting string!');
        }

        foreach ($results as $result) {
            $response[] = new static($result, $this->encoding);
        }

        return $response;
    }
public function explode($delimiter): array
    {
        Assert::typeOf(['string', __CLASS__], $delimiter);

        $response = [];
        $results  = explode((string) $delimiter, $this->data);

        if ($results === false) {
            throw new RuntimeException('An unknown error occurred while splitting string!');
        }

        foreach ($results as $result) {
            $response[] = new static($result, $this->encoding);
        }

        return $response;
    }
public function explode ( $ delimiter ) : array { Assert :: typeOf ( [ 'string' , __CLASS__ ] , $ delimiter ) ; $ response = [ ] ; $ results = explode ( ( string ) $ delimiter , $ this -> data ) ; if ( $ results === false ) { throw new RuntimeException ( 'An unknown error occurred while splitting string!' ) ; } foreach ( $ results as $ result ) { $ response [ ] = new static ( $ result , $ this -> encoding ) ; } return $ response ; }
Explodes this string by specified delimiter

@param static|string $delimiter
@return static[]
@throws InvalidArgumentException
@throws RuntimeException
@throws TypeError
Explodes this string by specified delimiter