Zephir\Passes\LocalContextPass::getNumberOfMutations PHP Method

getNumberOfMutations() public method

Returns the number of assignment instructions that mutated a variable
public getNumberOfMutations ( string $variable ) : integer
$variable string
return integer
    public function getNumberOfMutations($variable)
    {
        if (isset($this->mutations[$variable])) {
            return $this->mutations[$variable];
        }
        return 0;
    }

Usage Example

コード例 #1
0
ファイル: SymbolTable.php プロジェクト: Jvbzephir/zephir
 /**
  * Returns the number of expected mutations for a variable
  *
  * @param string $variable
  * @return int
  */
 public function getExpectedMutations($variable)
 {
     if ($this->localContext) {
         return $this->localContext->getNumberOfMutations($variable);
     }
     return 0;
 }