I'm sorry for the weird title. First, I'll start with the example:
<?php
class Test
{
public function __construct(public int $i) { }
}
/** @var ArrayObject<int, Test> */
$list = new ArrayObject([
new Test(1),
new Test(2),
]);
[$first, $second] = $list;
When I type $list[0]->, the LSP will provide type hints for the \Test class.
It won't work, however, when I type $first->.
I'm sorry for the weird title. First, I'll start with the example:
When I type
$list[0]->
, the LSP will provide type hints for the\Test
class.It won't work, however, when I type
$first->
.Intelephense version: 1.9.5