Zephir\Call::checkTempParameters PHP Метод

checkTempParameters() публичный Метод

Checks if temporary parameters must be copied or not
public checkTempParameters ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext
    public function checkTempParameters(CompilationContext $compilationContext)
    {
        $compilationContext->headersManager->add('kernel/fcall');
        foreach ($this->getMustCheckForCopyVariables() as $checkVariable) {
            $compilationContext->codePrinter->output('zephir_check_temp_parameter(' . $checkVariable . ');');
        }
    }

Usage Example

Пример #1
0
 /**
  *
  * @param array $expression
  * @param Call $call
  * @param CompilationContext $context
  */
 public function optimize(array $expression, Call $call, CompilationContext $context)
 {
     if (!isset($expression['parameters'])) {
         return false;
     }
     if (count($expression['parameters']) != 1) {
         throw new CompilerException("'phql_parse_phql' only accepts one parameter", $expression);
     }
     /**
      * Process the expected symbol to be returned
      */
     $call->processExpectedReturn($context);
     $symbolVariable = $call->getSymbolVariable();
     if ($symbolVariable->getType() != 'variable') {
         throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression);
     }
     if ($call->mustInitSymbolVariable()) {
         $symbolVariable->initVariant($context);
     }
     $symbolVariable->setDynamicTypes('array');
     $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression);
     $context->headersManager->add('phalcon/mvc/model/query/scanner', HeadersManager::POSITION_LAST);
     $context->headersManager->add('phalcon/mvc/model/query/phql', HeadersManager::POSITION_LAST);
     $call->addCallStatusFlag($context);
     $context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC);');
     $call->checkTempParameters($context);
     $call->addCallStatusOrJump($context);
     return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
 }
All Usage Examples Of Zephir\Call::checkTempParameters