Skip to content

Commit 460bbc8

Browse files
committed
Add clarifying comment for SEND_VAL usage
This confused me for a bit, because we're using SEND_VAL here to potentially perform a by-ref SEND, while it is usually used for by-val SENDs.
1 parent 7f34afc commit 460bbc8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_compile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,9 @@ static uint32_t zend_compile_args(
34873487
if (ARG_MUST_BE_SENT_BY_REF(fbc, arg_num)) {
34883488
opcode = ZEND_SEND_VAR_NO_REF;
34893489
} else if (ARG_MAY_BE_SENT_BY_REF(fbc, arg_num)) {
3490+
/* For IS_VAR operands, SEND_VAL will pass through the operand without
3491+
* dereferencing, so it will use a by-ref pass if the call returned by-ref
3492+
* and a by-value pass if it returned by-value. */
34903493
opcode = ZEND_SEND_VAL;
34913494
} else {
34923495
opcode = ZEND_SEND_VAR;

0 commit comments

Comments
 (0)