PHPStorm 2016.2.1 cannot find a property (Ctrl + Left Mouse) Example

$data = new class { public $current_page = 0; }; $data->current_page; // Клик приводит к ошибке Cannot find declaration to go to 

Will phpdoc help in this case or is it a purely storm problem?

  • I may not understand something, but how can we access the property of a class object without its instance? - MaximPro
  • '$ data = new class {};' Please, here is a copy of the anonymous class - Abyss
  • my interpreter swears at such a construction, apparently this is for a completely new php (I have php 5.6) - MaximPro
  • It's time to upgrade - Abyss
  • 5.6 is a fairly up-to-date version, I don’t think that everyone is set to version 7.0 on hosting, all the more so why should I use anonymous classes when there are enough ordinary eyesMaximPro

1 answer 1

As an alternative, you can use it, but this may not always help if you have non-unique properties.

  1. Highlight current_page
  2. Press Ctrl + Alt + O
  3. Enter