anchor.diff:      {ok,#reg_func{type=builtin, pack_args=PackArgs, builtin={M,F}}}
               when is_atom(M) andalso is_atom(F) ->
           {Args, NState} = resolve_args(RawArgs, State),
  -        {ok, Mirror} = start_mirror(NState#state{global=Ref}),
  +        save_state(NState),
           Value = if
  -            PackArgs -> erlang:apply(M,F,[Mirror,Index,Args]);
  -            true -> erlang:apply(M,F,[Mirror,Index|Args])
  +            PackArgs -> erlang:apply(M,F,[Ref,Index,Args]);
  +            true -> erlang:apply(M,F,[Ref,Index|Args])
           end,
  -        destroy(Mirror),
  -        {Value, NState};
  +        {Value, load_state(Ref)};
       {ok,#reg_func{type=builtin, pack_args=PackArgs, builtin=F}}
               when is_function(F) ->
           {Args, NState} = resolve_args(RawArgs, State),
  -        {ok, Mirror} = start_mirror(NState#state{global=Ref}),
  +        save_state(NState),
           Value = if
  -            PackArgs -> F([Mirror,Index,Args]);
  -            true -> F([Mirror,Index|Args])
  +            PackArgs -> F([Ref,Index,Args]);
  +            true -> F([Ref,Index|Args])
           end,
  -        destroy(Mirror),
  -        {Value, NState};
  +        {Value, load_state(Ref)};
       {ok,#reg_func{type=php, args=RawFuncArgs, code=Code}} ->
           {Args, NStatePrev} = resolve_args(RawArgs, State),
           {FuncArgs, NState} = resolve_func_args(RawFuncArgs, NStatePrev),
  
positive.code: 
  start_link(#state{ref=Ref}=State) when is_reference(Ref) ->
      {ok, Vars} = ephp_vars:start_link(),
      erlang:put(Ref, State#state{
          ref = Ref,
          vars = Vars
      }),
  
negative.code: resolve({global, GVars,_Line}, #state{
          global=GlobalCtx,
          vars=Vars}=State) ->
      #state{vars=GlobalVars} = load_state(GlobalCtx),
      lists:foreach(fun(GlobalVar) ->
          ephp_vars:ref(Vars, GlobalVar, GlobalVars, GlobalVar)
      end, GVars),
  