public function value($value)
    {
        //terminal case
        if (!is_array($value)) {
            if (strpbrk($value, Lexer::ESCAPED_STRING) !== false) {
                if (!(substr($value, 0, 1) == '"' && substr($value, -1) == '"')) {
                    return '(' . addcslashes($value, Lexer::ESCAPED_STRING_PAREN_ENCAPSED) . ')';
                }
            }
            return $value;
        }

        //composite value case
        $pairs = array();
        foreach ($value as $key => $subval) {
            $pairs[] = "{$this->identifier($key)} = {$this->value($subval)}";
        }

        return '(' . implode(', ', $pairs) . ')';
    }
public function value($value)
    {
        //terminal case
        if (!is_array($value)) {
            if (strpbrk($value, Lexer::ESCAPED_STRING) !== false) {
                if (!(substr($value, 0, 1) == '"' && substr($value, -1) == '"')) {
                    return '(' . addcslashes($value, Lexer::ESCAPED_STRING_PAREN_ENCAPSED) . ')';
                }
            }
            return $value;
        }

        //composite value case
        $pairs = array();
        foreach ($value as $key => $subval) {
            $pairs[] = "{$this->identifier($key)} = {$this->value($subval)}";
        }

        return '(' . implode(', ', $pairs) . ')';
    }
public function value ( $ value ) { //terminal case if ( ! is_array ( $ value ) ) { if ( strpbrk ( $ value , Lexer :: ESCAPED_STRING ) !== false ) { if ( ! ( substr ( $ value , 0 , 1 ) == '"' && substr ( $ value , - 1 ) == '"' ) ) { return '(' . addcslashes ( $ value , Lexer :: ESCAPED_STRING_PAREN_ENCAPSED ) . ')' ; } } return $ value ; } //composite value case $ pairs = array ( ) ; foreach ( $ value as $ key => $ subval ) { $ pairs [ ] = "{$this->identifier($key)} = {$this->value($subval)}" ; } return '(' . implode ( ', ' , $ pairs ) . ')' ; }
Compile a value

@param string $value
@return string
Compile a value