<?php
$variable = end($array);
$variable++;

I have the same issue when trying to update global variables within function.
Here is sample snippet to reproduce problem:
<?php
function test() {
global $scripts, $styles;
$scripts = new Scripts();
$styles = new Styles();
}
And result:

--
vscode 1.31.1
os x 10.11.6
intelephense 1.0.4
@xiaohuilam should $last be considered used though? In the example it's just a variable that gets declared then incremented.
@xiaohuilam should
$lastbe considered used though? In the example it's just a variable that gets declared then incremented.
$last ++;
means
$last = $last + 1;
Right, I see it fails in cases like this.
function fn() {
$i = 0;
return ++$i;
}
Similar problem with array.
<?php
function test() {
$array = array();
$array['one'] = 1;
$array['two'] = 2;
}


I think im having a similair problem? im not a very good PHP coder. but this shouldnt say its unused in my opinion?
Most helpful comment
I have the same issue when trying to update global variables within function.
Here is sample snippet to reproduce problem:
And result:

--
vscode 1.31.1
os x 10.11.6
intelephense 1.0.4