PhpSandbox\PHPSandbox::defineMagicConst PHP Method

defineMagicConst() public method

You can pass the magic constant $name and $value to define, or an associative array of magic constants to define
public defineMagicConst ( string | array $name, mixed $value )
$name string | array String of magic constant $name or associative array to define
$value mixed Value to define magic constant to, can be callable
    public function defineMagicConst($name, $value)
    {
        if (is_array($name)) {
            return $this->defineMagicConsts($name);
        }
        if (!$name) {
            $this->validationError("Cannot define unnamed magic constant!", Error::DEFINE_MAGIC_CONST_ERROR, null, '');
        }
        $name = $this->normalizeMagicConst($name);
        $this->definitions['magic_constants'][$name] = $value;
        return $this;
    }
PHPSandbox