PhpSandbox\PHPSandbox::defineConst PHP Méthode

defineConst() public méthode

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