Static property cannot be unset (bug in Phpstorm)

Hello all -

I have a problem with Phpstorm.  One of the code lines I have has a squiggly red line under it and there is no way to get rid of it, even though the code is correct, and works.

The problem is that if I have a static property which is an array, and I try to unset one of the array elements, and I using a dynamic class reference, I get the squiggly red line.

In other words:

unset( SomeClass::$someArray[ $key ] );  <-- No squiggly red line

vs.

/** @var SomeClass */

$className = 'SomeClass';

unset( $className::$someArray[ $key ] ); <-- Squiggly red line telling me I cannot unset static properties (which I am not doing).

There is no way for me to get rid of this squiggly red line.  Running code inspection doesn't even say it's an error, so there is nothing to disable.

Help.

1 comment
Comment actions Permalink

Thanks for sharing the example, I have managed to reproduce the scenario and reported it on YouTrack:

https://youtrack.jetbrains.com/issue/WI-56559 (please feel free to vote & follow)

 

0

Please sign in to leave a comment.