diff options
author | Nikita Popov <nikic@php.net> | 2016-04-10 13:01:54 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-04-15 15:32:20 +0200 |
commit | 64f91774f225e78a79c3623b185ae8b64ef9e30b (patch) | |
tree | a0947c110c53409cbdc585b20a9800adf11e5fac /ext/standard/var.c | |
parent | fd2cd354291d77f8949f905b50218e74463f3e7a (diff) | |
download | php-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 'ext/standard/var.c')
-rw-r--r-- | ext/standard/var.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/standard/var.c b/ext/standard/var.c index acb1d40c01..76d92a5fd3 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1080,6 +1080,11 @@ PHP_FUNCTION(unserialize) in case nesting calls to unserialize */ var_push_dtor(&var_hash, return_value); + /* Ensure return value is a value */ + if (Z_ISREF_P(return_value)) { + zend_unwrap_reference(return_value); + } + PHP_VAR_UNSERIALIZE_DESTROY(var_hash); if (class_hash) { zend_hash_destroy(class_hash); |