How to define variables in phpstorm

In my PHP project I'm using static-file server (ex That server path I have is stored in

table. (
During developement static server-file is local server (main root).
Problem is that when using it I don't get path suggestions (ctrl+space) eg:
<img src="<?=$this->config['file_server'];?>image.png">

Can I make phpstorm to interprate

Comment actions Permalink

is there any solution??

Comment actions Permalink

Hi there,

You cannot.

  • The actual inspection is disabled in such situations on purpose (to avoid false warnings .. since it is unknown in advance what that path would be).
  • IDE currently does not allow to provide value or return type for individual array elements anyway

On another hand -- it works just fine if leading "/" is actually present, i.e.

<img src="<?=$this->config['file_server'];?>/image.png">
(in such case path completion works)


Please sign in to leave a comment.