private function parseItem()
    {
        $subparser = new StringValue($this->parser, ($this->level + 1));
        $subparser->parse();

        $key = $subparser->getValue();

        $this->debug('key: ' . var_export($key, true));

        if ($this->tokenIs(T_DOUBLE_ARROW)) {
            // We MUST have an key when double arrow is encountered.
            if ($key === null) {
                $this->bailUnexpectedToken();
            }

            $this->pushStack($key);
            $this->parseValue();
            $this->popStack();
        } elseif ($this->tokenIs(',') || $this->tokenIs(')') || $this->tokenIs(']')) {
            // String item without key.
            $this->debug('String item without key.');
            $this->pushStack($this->counter++);
            $this->parser->setValue($this->parser->getStack(), $key);
            $this->popStack();
        }

        if ($this->tokenIs(',')) {
            $this->getNextToken();
            return true;
        }
        if ($this->tokenIs(')') || $this->tokenIs(']')) {
            $this->debug('closing bracket.');
            $this->getNextToken();

            return false;
        }

        return true;
    }
private function parseItem()
    {
        $subparser = new StringValue($this->parser, ($this->level + 1));
        $subparser->parse();

        $key = $subparser->getValue();

        $this->debug('key: ' . var_export($key, true));

        if ($this->tokenIs(T_DOUBLE_ARROW)) {
            // We MUST have an key when double arrow is encountered.
            if ($key === null) {
                $this->bailUnexpectedToken();
            }

            $this->pushStack($key);
            $this->parseValue();
            $this->popStack();
        } elseif ($this->tokenIs(',') || $this->tokenIs(')') || $this->tokenIs(']')) {
            // String item without key.
            $this->debug('String item without key.');
            $this->pushStack($this->counter++);
            $this->parser->setValue($this->parser->getStack(), $key);
            $this->popStack();
        }

        if ($this->tokenIs(',')) {
            $this->getNextToken();
            return true;
        }
        if ($this->tokenIs(')') || $this->tokenIs(']')) {
            $this->debug('closing bracket.');
            $this->getNextToken();

            return false;
        }

        return true;
    }
private function parseItem ( ) { $ subparser = new StringValue ( $ this -> parser , ( $ this -> level + 1 ) ) ; $ subparser -> parse ( ) ; $ key = $ subparser -> getValue ( ) ; $ this -> debug ( 'key: ' . var_export ( $ key , true ) ) ; if ( $ this -> tokenIs ( T_DOUBLE_ARROW ) ) { // We MUST have an key when double arrow is encountered. if ( $ key === null ) { $ this -> bailUnexpectedToken ( ) ; } $ this -> pushStack ( $ key ) ; $ this -> parseValue ( ) ; $ this -> popStack ( ) ; } elseif ( $ this -> tokenIs ( ',' ) || $ this -> tokenIs ( ')' ) || $ this -> tokenIs ( ']' ) ) { // String item without key. $ this -> debug ( 'String item without key.' ) ; $ this -> pushStack ( $ this -> counter ++ ) ; $ this -> parser -> setValue ( $ this -> parser -> getStack ( ) , $ key ) ; $ this -> popStack ( ) ; } if ( $ this -> tokenIs ( ',' ) ) { $ this -> getNextToken ( ) ; return true ; } if ( $ this -> tokenIs ( ')' ) || $ this -> tokenIs ( ']' ) ) { $ this -> debug ( 'closing bracket.' ) ; $ this -> getNextToken ( ) ; return false ; } return true ; }
Parse an array value.

Returns true if the parsing shall continue or false if the parsing is done.

@return bool
Parse an array value .