anchor.diff:  
   resolve({pre_incr, Var, _Line}, #state{ref = Ref} = State) ->
       case get_var_path(Var, State) of
  -        #variable{}=VarPath ->
  -            case ephp_vars:get(State#state.vars, VarPath, Ref) of
  -                undefined ->
  -                    ephp_vars:set(State#state.vars, VarPath, 1, Ref),
  -                    {1, State};
  -                V when is_number(V) ->
  -                    ephp_vars:set(State#state.vars, VarPath, V+1, Ref),
  -                    {V+1, State};
  -                V when is_binary(V) andalso byte_size(V) > 0 ->
  -                    NewVal = try
  -                        binary_to_integer(V) + 1
  -                    catch error:badarg ->
  -                        ephp_data:increment_code(V)
  -                    end,
  -                    ephp_vars:set(State#state.vars, VarPath, NewVal, Ref),
  -                    {NewVal, State};
  -                V ->
  -                    {V, State}
  -            end;
  +        #variable{} = VarPath ->
  +            Value = ephp_vars:get(State#state.vars, VarPath, Ref),
  +            NewValue = rich_increment(Value),
  +            if
  +                ?IS_MEM(Value) -> ephp_mem:set(Value, NewValue);
  +                true -> ephp_vars:set(State#state.vars, VarPath, NewValue, Ref)
  +            end,
  +            {NewValue, State};
           {error, _Reason} ->
               {undefined, State}
       end;
  
positive.code: 
  resolve({global, GVars, _Line},
          #state{ref = Ref, global = GlobalCtx, vars = Vars} = State) ->
      #state{vars=GlobalVars} = load_state(GlobalCtx),
      lists:foreach(fun(GlobalVar) ->
          ephp_vars:ref(Vars, GlobalVar, GlobalVars, GlobalVar, Ref)
      end, GVars),
  
negative.code: 
  resolve({post_incr, Var, _Line}, #state{ref = Ref} = State) ->
      VarPath = get_var_path(Var, State),
      Value = ephp_vars:get(State#state.vars, VarPath, Ref),
      {OldValue, NewValue} = increment(Value),
      if
          ?IS_MEM(Value) -> ephp_mem:set(Value, NewValue);
          true -> ephp_vars:set(State#state.vars, VarPath, NewValue, Ref)
      end,
      {OldValue, State};
  
  resolve({post_decr, Var, _Line}, #state{ref = Ref} = State) ->
      VarPath = get_var_path(Var, State),
  