C
C
ChAk2015-02-21 15:55:13
PHP
ChAk, 2015-02-21 15:55:13

Bug or feature of PHPStorm that broke my project?

To understand what I mean, we do a simple experiment
Create a file 1.php
var_dump($id);
Create file 2.php
$id = 2;
Create file 3.php
$id = 3;
All this is enough for phpstorm to get confused and break your project.
The IDE associates $id in file 1 with $id in file 2. This is the first bug, since these files are not related in any way.
At the same time, $id in file 1 has nothing to do with $id in file 3. The second bug, if the first one is not a bug, but a feature.
That is, in any case, there is an obvious bug here.
How does the project break down? If you haven’t guessed yet, it’s very simple to rename $id using refactoring in 1 file, it also changes in 2, but does not change in 3. No matter how your project is arranged, this will break it.
Question: Maybe I'm doing something wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Arman, 2015-02-21
@Arik

I use the git or mercurial versioning system, even when I work alone, and before making a commit, I always look at what changes have been. This practice saves a lot, it’s rare that the left hits the combat server

U
Unknown Hero, 2015-02-21
@UnknownHero

Use classes.
They have never had problems with refactoring

M
Maxim, 2016-10-06
@pudovMaxim

Instead of depends on openness of these files? For example, if tabs with file 1 and 2 are open, will they change?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question