QafooLabs/php-refactoring-browser — pull request #45 by tomphp (2013-12-15 20:28:49+00:00)
Title: Stop rename local variables corrupting variables with similar names

This PR fixes an issue where when renaming a local variable which appears on the same line as another variable which starts with the name of the variable being changed, then it corrupts the name of the other variable.

e.g. In the following situation

```php
class X
{
public function methodY()
{
$foo = 7;
$foobaz = 5;

$foo = $foo + $foobaz;
}
}
```

If you use the rename local variable function to rename `$foo` to `$bar` then `$foobaz` on the line which says `$foo = $foo + $foobaz;` will mistakenly be renamed to `$barbaz`