本文整理匯總了PHP中Call::mustInitSymbolVariable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Call::mustInitSymbolVariable方法的具體用法?PHP Call::mustInitSymbolVariable怎麽用?PHP Call::mustInitSymbolVariable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Call
的用法示例。
在下文中一共展示了Call::mustInitSymbolVariable方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: optimize
public function optimize(array $expression, Call $call, CompilationContext $context)
{
/**
* Process the expected symbol to be returned
*/
$call->processExpectedReturn($context);
$symbolVariable = $call->getSymbolVariable();
if ($symbolVariable->isNotVariableAndString()) {
throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression);
}
if ($call->mustInitSymbolVariable()) {
$symbolVariable->initVariant($context);
}
$context->headersManager->add('my_mandelbrot');
$symbolVariable->setDynamicTypes('bool');
$resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression);
$context->codePrinter->output('ZVAL_BOOL(' . $symbolVariable->getRealName() . ', my_mandelbrot_to_file(' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ', ' . $resolvedParams[3] . '));');
return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
}