I have found a bug in Mathematica 10.0. I'm not sure where to report it, but here is Mathematica input that will generate it:
TestFunc1 = x;
TestFunc2 = y + y^2;
(*This simplify uses the 'local' x value and returns "1" *)
x = 2;
Simplify[TestFunc1 /. x -> 1]
(*This simplify uses the 'global' y value and returns "6" *)
y = 2;
Simplify[TestFunc2 /. y -> 1]
Note that the (assumptively) local/global variables "x" and "y" are treated differently depending on the form of the function they are in. I have also found hybrid behavior where a larger function of x will use the 'global' x value for some x's and the 'local' x value for others.
Obviously using variables in this way is not good practice, but Mathematica should fail more gracefully/consistently.
You're absolutely right; I didn't realize that Mathematica would order the operation that way. Thanks!
The results seem fine, given what is being evaluated in both cases: 2 /. 2 -> 1 and 6 /. 2 -> 1 respectively.
2 /. 2 -> 1
6 /. 2 -> 1