@@ -2072,6 +2072,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
2072
2072
arg_num = 1;
2073
2073
param = ZEND_CALL_ARG(EX(call), 1);
2074
2074
ZEND_HASH_FOREACH_VAL(ht, arg) {
2075
+ zend_bool must_wrap = 0;
2075
2076
if (skip > 0) {
2076
2077
skip--;
2077
2078
continue;
@@ -2083,6 +2084,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
2083
2084
/* By-value send is not allowed -- emit a warning,
2084
2085
* but still perform the call. */
2085
2086
zend_param_must_be_ref(EX(call)->func, arg_num);
2087
+ must_wrap = 1;
2086
2088
}
2087
2089
}
2088
2090
} else {
@@ -2092,7 +2094,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
2092
2094
arg = Z_REFVAL_P(arg);
2093
2095
}
2094
2096
}
2095
- ZVAL_COPY(param, arg);
2097
+ if (EXPECTED(!must_wrap)) {
2098
+ ZVAL_COPY(param, arg);
2099
+ } else {
2100
+ ZVAL_NEW_REF(param, arg);
2101
+ }
2096
2102
ZEND_CALL_NUM_ARGS(EX(call))++;
2097
2103
arg_num++;
2098
2104
param++;
@@ -2104,12 +2110,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
2104
2110
arg_num = 1;
2105
2111
param = ZEND_CALL_ARG(EX(call), 1);
2106
2112
ZEND_HASH_FOREACH_VAL(ht, arg) {
2113
+ zend_bool must_wrap = 0;
2107
2114
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
2108
2115
if (UNEXPECTED(!Z_ISREF_P(arg))) {
2109
2116
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
2110
2117
/* By-value send is not allowed -- emit a warning,
2111
2118
* but still perform the call. */
2112
2119
zend_param_must_be_ref(EX(call)->func, arg_num);
2120
+ must_wrap = 1;
2113
2121
}
2114
2122
}
2115
2123
} else {
@@ -2119,7 +2127,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
2119
2127
arg = Z_REFVAL_P(arg);
2120
2128
}
2121
2129
}
2122
- ZVAL_COPY(param, arg);
2130
+ if (EXPECTED(!must_wrap)) {
2131
+ ZVAL_COPY(param, arg);
2132
+ } else {
2133
+ ZVAL_NEW_REF(param, arg);
2134
+ }
2123
2135
ZEND_CALL_NUM_ARGS(EX(call))++;
2124
2136
arg_num++;
2125
2137
param++;
0 commit comments