anchor.diff:      {BoolValue, NewState}.
   
   get_class_name(#reg_instance{class=#class{name=Name}}) -> Name.
  +
  +-spec load_state(context()) -> #state{}.
  +
  +load_state(Context) ->
  +    erlang:get(Context).
  +
  +-spec save_state(#state{}) -> #state{} | undefined.
  +
  +save_state(#state{ref=Ref} = State) ->
  +    erlang:put(Ref, State).
  
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: 
  register_func(Context, PHPFunc, Module, Fun, PackArgs)
          when is_atom(Module) andalso is_atom(Fun) ->
      #state{funcs=Funcs} = load_state(Context),
      ephp_func:register_func(Funcs, PHPFunc, Module, Fun, PackArgs),
      ok;
  
  register_func(Context, PHPFunc, Args, Code, PackArgs) ->
      #state{funcs=Funcs} = load_state(Context),
      ephp_func:register_func(Funcs, PHPFunc, Args, Code, PackArgs),
      ok.
  
  register_func(Context, PHPFunc, Module, Fun)
          when is_atom(Module) andalso is_atom(Fun) ->
      #state{funcs=Funcs} = load_state(Context),
      ephp_func:register_func(Funcs, PHPFunc, Module, Fun),
      ok;
  
  register_func(Context, PHPFunc, Args, Code) ->
      #state{funcs=Funcs} = load_state(Context),
      ephp_func:register_func(Funcs, PHPFunc, Args, Code),
      ok.
  
  register_func(Context, PHPFunc, Fun) ->
      #state{funcs=Funcs} = load_state(Context),
      ephp_func:register_func(Funcs, PHPFunc, Fun),
      ok.
  
  get_functions(Context) ->
      #state{funcs=Funcs} = load_state(Context),
      ephp_func:get_functions(Funcs).
  
  get_function(Context, FuncName) ->
      #state{funcs=Funcs} = load_state(Context),
      ephp_func:get(Funcs, FuncName).
  
  get_current_function(Context) ->
      #state{active_fun=ActiveFun} = load_state(Context),
      ActiveFun.
  
  get_current_function_arity(Context) ->
      #state{active_fun_args=ActiveFunArgs} = load_state(Context),
      ActiveFunArgs.
  
  get_current_class(Context) ->
      #state{active_class=ActiveClass} = load_state(Context),
      ActiveClass.
  
  get_errors_id(Context) ->
      #state{errors=Errors} = load_state(Context),
      Errors.
  
  set_errors_id(Context, Errors) ->
      State = load_state(Context),
      save_state(State#state{errors=Errors}),
      ok.
  
  get_const(Context, Name, Index) ->
      #state{const=Const} = load_state(Context),
      ephp_const:get(Const, Name, Index, Context).
  
  register_const(Context, Name, Value) ->
      #state{const=Const} = load_state(Context),
      ephp_const:set(Const, Name, Value),
      ok.
  
  call_method(Context, Instance, Call) ->
      {Val, NS} = run_method(Instance, Call, load_state(Context)),
      save_state(NS),
      Val.
  
  get_active_file(Context) ->
      #state{active_file=Filename} = load_state(Context),
      Filename.
  
  set_active_file(Context, undefined) ->
      Filename = <<"php shell code">>,
      {ok, Cwd} = file:get_cwd(),
      #state{const=Const} = State = load_state(Context),
      save_state(State#state{active_file=Filename}),
      ephp_const:set_bulk(Const, [
          {<<"__FILE__">>, Filename},
          {<<"__DIR__">>, list_to_binary(Cwd)}
  