You have a temporary variable that is created with a simple expression. Now the temp is getting into the way of other refactorings. Replace all references to the temporary variable with the expression.

Motivation

Often you will find yourself having temporary variables that carry the contents of simple method calls. A good thing is to remove the temporary variables and replace all references with the method or function invoked. This leads to much clearer code, as the method or function name ideally speaks for itself already, and saves you one code line. The less code the better!

Also, often you can use Inline Temp when you are having too many temporary variables around so that extracting functionality into their own methods (called Extract Method) becomes difficult. An article about Extract Method will be written later.

Beware of using Inline Temp in connection with loops as this can sometimes cause disastrious performance issues. Check Optimising Loops for further information about that.

I think this is good advice. The only instance I would recommend against using the expression versus variable is with loops. For instance, instead of using a for loop with the expression 'count($variable)', it would be better to have $num = count($variable) before the function and then compare to the $num variable. This way the function doesn't need to run with each iteration of the loop.

So, I agree - but I think it still takes some discretion as to where to do this.

@TIm
Sorry about that, I didn't realize you had another article on here related to that topic. I am just starting to check out the rest of your site, but hadn't stumbled upon that. Feel free to delete my comments if necessary :)