diff --git a/include/value.h b/include/value.h index f72304cf..87465388 100644 --- a/include/value.h +++ b/include/value.h @@ -381,6 +381,25 @@ class Value : private HashParent bool isArray() const { return type() == Type::Array; } bool isCallable() const; + /** + * Get a reference of this Value. + * + * @return Value + */ + Value ref() const { + return Value(_val, true); + } + + /** + * To check for reference equality. + * @param value + * @return bool + */ + bool refequals(const Value &value) const + { + return isRef() && _val == value._val; + } + /** * Get access to the raw buffer - you can use this for direct reading and * writing to and from the buffer. Note that this only works for string