echo"result is " .$n;
If you leave in the $n=$e, the loop will run once only as it is at the max permissible value (8).
If you have the incrementer ($n++ or $n=$n+1) inside the conditional structure, you will get an infinite loop once the value of $n is odd.
The above code should give:
result is 2
result is 4
result is 6
result is 8
I'm a little confused as to what the code is supposed to do.