I'm working on someone else's PHP code and my IDE (PHPstorm) is flagging this line with the error Cannot use [] for reading
. The code works fine, but I'm trying to understand why with my limited PHP skills. I've seen double dollar signs in other files and with no error.
$somevar = ($test_me) ? "some-class" : "some-other-class";
$$somevar[] = $some_value; // $somevar[] is flagged