Zephir\Passes\LocalContextPass::passExpression PHP Method

passExpression() public method

public passExpression ( array $expression )
$expression array
    public function passExpression(array $expression)
    {
        switch ($expression['type']) {
            case 'bool':
            case 'double':
            case 'int':
            case 'uint':
            case 'long':
            case 'ulong':
            case 'string':
            case 'istring':
            case 'null':
            case 'char':
            case 'uchar':
            case 'empty-array':
            case 'constant':
            case 'static-constant-access':
            case 'closure':
            case 'closure-arrow':
                break;
            case 'variable':
                $this->markLastUse($expression['value'], $expression);
                break;
            case 'reference':
                if ($expression['left']['type'] == 'variable') {
                    $this->markVariableNoLocal($expression['left']['value']);
                }
                break;
            case 'sub':
            case 'add':
            case 'div':
            case 'mul':
            case 'mod':
            case 'and':
            case 'or':
            case 'concat':
            case 'equals':
            case 'identical':
            case 'not-identical':
            case 'not-equals':
            case 'less':
            case 'greater':
            case 'greater-equal':
            case 'less-equal':
            case 'bitwise_and':
            case 'bitwise_or':
            case 'bitwise_xor':
            case 'bitwise_shiftleft':
            case 'bitwise_shiftright':
            case 'irange':
            case 'erange':
                $this->passExpression($expression['left']);
                $this->passExpression($expression['right']);
                break;
            case 'typeof':
            case 'bitwise_not':
            case 'not':
                $this->passExpression($expression['left']);
                break;
            case 'mcall':
            case 'fcall':
            case 'scall':
                if ($expression['type'] == 'mcall') {
                    if (isset($expression['variable'])) {
                        if ($expression['variable']['type'] == 'variable') {
                            $this->markVariableNoLocal($expression['variable']['value']);
                        }
                    }
                }
                $this->passCall($expression);
                $this->lastCallLine = $expression['line'];
                break;
            case 'array':
                $this->passArray($expression);
                break;
            case 'new':
            case 'new-type':
                $this->passNew($expression);
                break;
            case 'property-access':
            case 'property-dynamic-access':
            case 'property-string-access':
            case 'static-property-access':
            case 'array-access':
                $this->passExpression($expression['left']);
                break;
            case 'isset':
            case 'empty':
            case 'instanceof':
            case 'require':
            case 'clone':
            case 'likely':
            case 'unlikely':
            case 'ternary':
            case 'short-ternary':
                $this->passExpression($expression['left']);
                break;
            case 'fetch':
                $this->increaseMutations($expression['left']['value']);
                $this->markVariableNoLocal($expression['left']['value']);
                $this->passExpression($expression['right']);
                break;
            case 'minus':
                $this->passExpression($expression['left']);
                break;
            case 'list':
                $this->passExpression($expression['left']);
                break;
            case 'cast':
            case 'type-hint':
                $this->passExpression($expression['right']);
                break;
            default:
                echo 'LocalContextPassType=', $expression['type'], PHP_EOL;
                break;
        }
    }