Eliminate uses of ZVAL_ZVAL and friends

Instead add RETURN_COPY(_VALUE) macros will the expected behavior.

RETURN_ZVAL doesn't make any sense since PHP 7, but has stuck
around, probably because the alternative was to write directly to
the return_value variable.
This commit is contained in:
Nikita Popov 2020-01-20 10:34:17 +01:00
parent 5947437d47
commit 6811222422
10 changed files with 20 additions and 29 deletions

View file

@ -2337,14 +2337,14 @@ PHP_FUNCTION(pg_last_notice)
if ((notice = zend_hash_get_current_data(Z_ARRVAL_P(notices))) == NULL) {
RETURN_EMPTY_STRING();
}
RETURN_ZVAL(notice, 1, 0);
RETURN_COPY(notice);
} else {
RETURN_EMPTY_STRING();
}
break;
case PGSQL_NOTICE_ALL:
if (notices) {
RETURN_ZVAL(notices, 1, 0);
RETURN_COPY(notices);
} else {
array_init(return_value);
return;