I just read about unset variable through php manual.
The php manual says \"unset() destroys the specified variables\"
This def seems per
Well, what unset()
does is clears up the memory associated with a variable name.
In the case of static variables, however, what you can visualize as happening is separating the static variable from the scope of the function, and every time you call the function, you automatically get a copy of that variable.
So, what this means is if you unset
a static variable, you are only actually unset
ting that copy, so when the function is called again, it "receives" a fresh copy.