src/Execution.php
public function setVariable($name, $value)
    {
        if ($value === null) {
            return $this->removeVariable($name);
        }
        
        return $this->getScopeRoot()->setVariableLocal($name, $value);
    }
public function setVariable($name, $value)
    {
        if ($value === null) {
            return $this->removeVariable($name);
        }
        
        return $this->getScopeRoot()->setVariableLocal($name, $value);
    }
Set the given variable in the scope root, passing a value of null will remove the variable.

@param string $name
@param mixed $value