private function processValue($value)
    {
        $this->valueStack[] = $value;
        $value = $this->resolveValue($value);

        if (is_array($value) || is_object($value)) {
            $this->pushStack($value);
        } else {
            $this->outputJson($value, JsonToken::T_VALUE);
            array_pop($this->valueStack);
        }
    }