Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (26 sloc) 0.819 kb
class Lexical{
static $scopes = array();
public static function init_closure($ns, $id){
self::$scopes[$ns][$id][] = array();
self::$scopes[$ns][$id] = array(array());
return $id;
public static function get_closure_id($ns, $id){
if($id === Null){
return Null;
return count(self::$scopes[$ns][$id])-1;
public static function bind_lexing($ns, $id, $var, &$val){
$closure_id = self::get_closure_id($ns, $id);
self::$scopes[$ns][$id][$closure_id][$var] =& $val;
public static function get_lexical_binding($ns, $id, $var, $closure_id){
return self::$scopes[$ns][$id][$closure_id][$var];
Jump to Line
Something went wrong with that request. Please try again.