This is perfectly normal - it's the difference between global and local variables. See:

http://manual.conitec.net/aarray.htm

"my" is a global pointer, and when you call a function that changes it, it's changed.

This is an example of a local pointer:

function new_test()
{
ENTITY* ent = ent_create("test2.mdl",nullvector,null);
ent.skill1 = 1;
}

Hope this helps...