PHPCfg\FuncContext::isLocalVariable PHP Method

isLocalVariable() public method

public isLocalVariable ( Block $block, $name )
$block Block
    public function isLocalVariable(Block $block, $name)
    {
        if (!isset($this->scope[$block])) {
            return false;
        }
        $vars = $this->scope[$block];
        return isset($vars[$name]);
    }

Usage Example

Beispiel #1
0
 private function readVariableName($name, Block $block)
 {
     if ($this->ctx->isLocalVariable($block, $name)) {
         return $this->ctx->scope[$block][$name];
     }
     return $this->readVariableRecursive($name, $block);
 }