API:getfenv

__NOTOC__
getfenv
Returns in which environment (i.e. the function code its executional context) a given function is active.
_env = getfenv ([func])
== Parameters ==
=== Arguments ===
:;func
::function|number - func can be a Lua function or a number that specifies the function at that stack level: Level 1 is the function calling getfenv. If the given function is not a Lua function, or if func is 0, getfenv returns the global environment. The default for func is 1.
=== Returns ===
:;_env
::table - The environment in which the function is operating. 
== Example ==
local myEnv = getfenv(myFunc);
== Notes ==
* http://www.lua.org/manual/5.1/manual.html#pdf-getfenv
* http://www.lua.org/manual/5.1/manual.html#2.3
* http://www.lua.org/manual/5.1/manual.html#2.9
* http://www.lua.org/manual/5.1/manual.html#pdf-_G
* http://www.lua.org/manual/5.1/manual.html#pdf-debug.getfenv
* http://www.lua.org/manual/5.1/manual.html#lua_getfenv
== Related Functions ==
* setfenv
* getglobal