derickr / vld

BSD 2-Clause "Simplified" License
467 stars 88 forks source link

SEND_VAL and others use second operand for the named argument #84

Open gmirchev opened 3 weeks ago

gmirchev commented 3 weeks ago

But VLD doesn't print the info.

More information:

From zend_compile.php - zend_compile_args():

            opline = zend_emit_op(NULL, opcode, &arg_node, NULL);
            if (arg_name) {
                    opline->op2_type = IS_CONST;
                    zend_string_addref(arg_name);
                    opline->op2.constant = zend_add_literal_string(&arg_name);
                    opline->result.num = zend_alloc_cache_slots(2);
            } else {
                    opline->op2.opline_num = arg_num;
                    opline->result.var = EX_NUM_TO_VAR(arg_num - 1);
            }

where opcode can be

ZEND_SEND_VAL_EX ZEND_SEND_VAL ZEND_SEND_VAR ZEND_SEND_REF ZEND_SEND_VAR_EX ZEND_SEND_FUNC_ARG ZEND_SEND_VAR_NO_REF ZEND_SEND_VAR_NO_REF_EX

gmirchev commented 3 weeks ago

Online-PHP-editor-vld-for-bspSe-09-26-2024_11_26_AM

gmirchev commented 3 weeks ago

Here we see that in SEND_VAR the variable name is shown. Online-PHP-editor-vld-for-NbGqJ-09-26-2024_11_32_AM