summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.h
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-04-10 13:01:54 +0200
committerNikita Popov <nikic@php.net>2016-04-15 15:32:20 +0200
commit64f91774f225e78a79c3623b185ae8b64ef9e30b (patch)
treea0947c110c53409cbdc585b20a9800adf11e5fac /Zend/zend_operators.h
parentfd2cd354291d77f8949f905b50218e74463f3e7a (diff)
downloadphp-git-64f91774f225e78a79c3623b185ae8b64ef9e30b.tar.gz
Remove IS_VAR_RET_REF flag
Instead decide whether a function returned by reference or by value by checking whether the return value has REFERENCE type. This means that functions returning by reference must always return a reference and functions returning by value must not return a reference.
Diffstat (limited to 'Zend/zend_operators.h')
-rw-r--r--Zend/zend_operators.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index db6162a4e5..405ca0926f 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -821,6 +821,18 @@ static zend_always_inline char *zend_print_long_to_buf(char *buf, zend_long num)
ZEND_API zend_string* ZEND_FASTCALL zend_long_to_str(zend_long num);
+static zend_always_inline void zend_unwrap_reference(zval *op) /* {{{ */
+{
+ if (Z_REFCOUNT_P(op) == 1) {
+ ZVAL_UNREF(op);
+ } else {
+ Z_DELREF_P(op);
+ ZVAL_COPY(op, Z_REFVAL_P(op));
+ }
+}
+/* }}} */
+
+
END_EXTERN_C()
#endif