Skip to content

Inline value for array access with variable key #1080

@bmewburn

Description

@bmewburn

I'm implementing an inline value provider in intelephense. When returning an InlineValueEvaluatableExpression for an array access expression with a variable for the key, the inline value is that of the array instead of the array element. Is it possible to resolve the element value here? If so, where in the code would I look if I was to attempt a PR?

<?php

$a = ['x', 'y', 'z'];
foreach ($a as $k => $v) {
    echo $a;
    echo $k;
    echo $v;
    echo $a[0];
    echo $a[$k];
    echo 1;
}
Image

The problem seems similar to #1077 . I am running version 1.38.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions