The previous value of the variable, or element(s) of the subscripted or sliced variable are discarded. For example, suppose x was a 1000-element sequence that we had initialized with:
object x
x =repeat(0,1000)-- a sequence of 1000 zeros
This is perfectly legal since x is declared as an object. The previous value of x, namely the 1000-element sequence, would simply disappear. Actually, the space consumed by the 1000-element sequence will be automatically recycled due to Phix’s dynamic storage allocation.
Note that the equals symbol '=' is used for both assignment and for equality testing. There is never any confusion because an assignment in Phix is a statement only, it cannot be used as an expression (as in C). Alternatively and optionally you can explicitly use ":=" for assignment and "==" for equality testing.