getenv()
function getenv(?string $name = null, bool $local_only = false): string|array|false
Gets the value of an environment variable, or the whole environment.
Parameters:
$name(?string), defaultnull, optional$local_only(bool), defaultfalse, optional
Returns: string|array|false
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/network_env/getenv.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how getenv is implemented in the compiler, see the internals page.