anchor.diff:      ok.
   
   get_tz(Context) ->
  -    #state{timezone=TZ} = erlang:get(Context),
  +    #state{timezone=TZ} = load_state(Context),
       TZ.
   
   set_tz(Context, TZ) ->
  -    State = erlang:get(Context),
  -    erlang:put(Context, State#state{timezone=TZ}),
  +    State = load_state(Context),
  +    save_state(State#state{timezone=TZ}),
       ok.
   
   get_output(Context) ->
  -    #state{output=Output} = erlang:get(Context),
  +    #state{output=Output} = load_state(Context),
       ephp_output:pop(Output).
   
   set_output(Context, Text) ->
  -    #state{output=Output} = erlang:get(Context),
  +    #state{output=Output} = load_state(Context),
       ephp_output:push(Output, Text),
       ok.
   
   set_output_handler(Context, Output) ->
  -    State = erlang:get(Context),
  +    State = load_state(Context),
       ephp_output:destroy(State#state.output),
  -    erlang:put(Context, State#state{output=Output}),
  +    save_state(State#state{output=Output}),
       ok.
   
   get_output_handler(Context) ->
  -    #state{output=Output} = erlang:get(Context),
  +    #state{output=Output} = load_state(Context),
       Output.
   
   load(Context, File) ->
  -    #state{include=Inc} = erlang:get(Context),
  +    #state{include=Inc} = load_state(Context),
       ephp_include:load(Inc, File).
   
   load_once(Context, File) ->
  -    #state{include=Inc} = erlang:get(Context),
  +    #state{include=Inc} = load_state(Context),
       ephp_include:load_once(Inc, File).
   
   register_class(Context, Class) ->
  -    #state{class=Classes, global=GlobalCtx} = erlang:get(Context),
  +    #state{class=Classes, global=GlobalCtx} = load_state(Context),
       ephp_class:register_class(Classes, GlobalCtx, Class),
       ok.
   
   set_class_alias(Context, ClassName, ClassAlias) ->
  -    #state{class=Classes} = erlang:get(Context),
  +    #state{class=Classes} = load_state(Context),
       ephp_class:set_alias(Classes, ClassName, ClassAlias).
   
   set_global(Context, GlobalContext) ->
  -    State = erlang:get(Context),
  -    erlang:put(Context, State#state{global=GlobalContext}),
  +    State = load_state(Context),
  +    save_state(State#state{global=GlobalContext}),
       ok.
   
   generate_subcontext(Context) ->
  -    State = erlang:get(Context),
  +    State = load_state(Context),
       start_link(State#state{
           ref=undefined,
           global=Context}).
   
   register_shutdown_func(Context, FuncName) ->
  -    #state{shutdown=Ref} = erlang:get(Context),
  +    #state{shutdown=Ref} = load_state(Context),
       ephp_shutdown:register_func(Ref, FuncName).
   
   unregister_shutdown_func(Context, FuncName) ->
  -    #state{shutdown=Ref} = erlang:get(Context),
  +    #state{shutdown=Ref} = load_state(Context),
       ephp_shutdown:unregister_func(Ref, FuncName).
   
   get_shutdown_funcs(Context) ->
  -    #state{shutdown=Ref} = erlang:get(Context),
  +    #state{shutdown=Ref} = load_state(Context),
       ephp_shutdown:get_funcs(Ref).
   
   %% ------------------------------------------------------------------
  
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:     ok;
  
  set_active_file(Context, Filename) ->
      #state{const=Const} = State = load_state(Context),
      save_state(State#state{active_file=Filename}),
      ephp_const:set_bulk(Const, [
          {<<"__FILE__">>, Filename},
          {<<"__DIR__">>, filename:dirname(Filename)}
  