src/Decoder.php
private function decodeList()
    {
        $list = array();
        $terminated = false;
        $listOffset = $this->offset;

        while (false !== $this->getChar()) {
            if ("e" == $this->getChar()) {
                $terminated = true;
                break;
            }

            $list[] = $this->doDecode();
        }

        if (!$terminated && false === $this->getChar()) {
            throw new RuntimeException("Unterminated list definition at offset $listOffset");
        }

        $this->offset++;

        return $list;
    }
private function decodeList()
    {
        $list = array();
        $terminated = false;
        $listOffset = $this->offset;

        while (false !== $this->getChar()) {
            if ("e" == $this->getChar()) {
                $terminated = true;
                break;
            }

            $list[] = $this->doDecode();
        }

        if (!$terminated && false === $this->getChar()) {
            throw new RuntimeException("Unterminated list definition at offset $listOffset");
        }

        $this->offset++;

        return $list;
    }
private function decodeList ( ) { $ list = array ( ) ; $ terminated = false ; $ listOffset = $ this -> offset ; while ( false !== $ this -> getChar ( ) ) { if ( "e" == $ this -> getChar ( ) ) { $ terminated = true ; break ; } $ list [ ] = $ this -> doDecode ( ) ; } if ( ! $ terminated && false === $ this -> getChar ( ) ) { throw new RuntimeException ( "Unterminated list definition at offset $listOffset" ) ; } $ this -> offset ++ ; return $ list ; }
Decode a bencode encoded list

@return array   Returns the decoded array.
@throws RuntimeException
Decode a bencode encoded list