php - Assign changed variable to the same variable is safe? -


Is this a good practice and do I have any possibility of furrow if I entrusted the changing value of my own variable?

For example

  $ myVar = 1; $ MyVar = $ myVar + 33 9 5 9 2; $ MyVar = rtrim ($ myVar, 2); $ MyVar = explosion (",", $ myVar);   

I know this will work but what is safe to do this in PHP?

This violates the practice of using good variable names If the variable actually represents the same thing then I consider reassigning it. As it does not represent the same thing in this matter, I consider it a "bad" or "code odor".

(However, "work safely" otherwise)

Happy coding.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -