Is there a formal term for functions that have static state across executions? Two examples, one in PHP:

function adder($i){
  static $a = 0; 
  $a += $i; 
  return $a;
}


A similar effect can be achieved with closures in javascript:

var adder = (function(){ 
  var a = 0; 
  return function(i){ 
    a += i;
    return a;
  } 
})();


In javascript I've really just created an object. Implementation details not withstanding, does stateful-functions have a formal name?
Not that I know of, but "stateful function" is reasonably descriptive.  In informal conversation, that's what I'd use, as long as I suspect the audience will understand what I mean.  In formal writing, I might still use the same phrase but also provide a careful definition of what I meant by that phrase.  Really, that's a large part of what "formal" writing is about: it's about being precise about what you mean.