define()
function define(string $constant_name, mixed $value): bool
Defines a named constant at runtime.
Parameters:
$constant_name(string)$value(mixed)
Returns: bool
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/core/define.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how define is implemented in the compiler, see the internals page.