src/Execution.php
public function getScope()
    {
        $exec = $this;
        
        while (!$exec->isScope() && !$exec->isScopeRoot()) {
            $exec = $exec->getParentExecution();
        }
        
        return $exec;
    }
public function getScope()
    {
        $exec = $this;
        
        while (!$exec->isScope() && !$exec->isScopeRoot()) {
            $exec = $exec->getParentExecution();
        }
        
        return $exec;
    }
Get the variable scope of this execution (not necessarily the execution itself).

@return Execution