Zephir\Statements\Let\ObjectPropertyArrayIndex::_assignPropertyArrayMultipleIndex PHP Метод

_assignPropertyArrayMultipleIndex() защищенный Метод

Compiles x->y[a][b] = {expr} (multiple offset assignment)
protected _assignPropertyArrayMultipleIndex ( string $variable, Variable $symbolVariable, Zephir\CompiledExpression $resolvedExpr, Zephir\CompilationContext $compilationContext, array $statement )
$variable string
$symbolVariable Zephir\Variable
$resolvedExpr Zephir\CompiledExpression
$compilationContext Zephir\CompilationContext
$statement array
    protected function _assignPropertyArrayMultipleIndex($variable, ZephirVariable $symbolVariable, CompiledExpression $resolvedExpr, CompilationContext $compilationContext, array $statement)
    {
        $codePrinter = $compilationContext->codePrinter;
        $property = $statement['property'];
        $compilationContext->headersManager->add('kernel/object');
        /**
         * Create a temporal zval (if needed)
         */
        $variableExpr = $this->_getResolvedArrayItem($resolvedExpr, $compilationContext);
        /**
         * Only string/variable/int
         */
        $offsetExprs = array();
        foreach ($statement['index-expr'] as $indexExpr) {
            $indexExpression = new Expression($indexExpr);
            $resolvedIndex = $indexExpression->compile($compilationContext);
            switch ($resolvedIndex->getType()) {
                case 'string':
                case 'int':
                case 'uint':
                case 'ulong':
                case 'long':
                case 'variable':
                    break;
                default:
                    throw new CompilerException("Expression: " . $resolvedIndex->getType() . " cannot be used as index without cast", $statement['index-expr']);
            }
            $offsetExprs[] = $resolvedIndex;
        }
        $compilationContext->backend->assignPropertyArrayMulti($symbolVariable, $variableExpr, $property, $offsetExprs, $compilationContext);
        if ($variableExpr->isTemporal()) {
            $variableExpr->setIdle(true);
        }
    }