本文整理匯總了PHP中Zephir\Variable::setReadOnly方法的典型用法代碼示例。如果您正苦於以下問題:PHP Variable::setReadOnly方法的具體用法?PHP Variable::setReadOnly怎麽用?PHP Variable::setReadOnly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zephir\Variable
的用法示例。
在下文中一共展示了Variable::setReadOnly方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* SymbolTable
*
* @param CompilationContext $compilationContext
*/
public function __construct(CompilationContext $compilationContext)
{
/* this_ptr */
$thisVar = new Variable('variable', 'this', $compilationContext->currentBranch);
$thisVar->setIsInitialized(true, $compilationContext, array());
$thisVar->increaseUses();
$thisVar->setReadOnly(true);
$thisVar->setLowName('this_ptr');
$thisVar->setDynamicTypes('object');
$this->variables['this'] = $thisVar;
$returnValue = new Variable('variable', 'return_value', $compilationContext->currentBranch);
$returnValue->setIsInitialized(true, $compilationContext, array());
$returnValue->increaseUses();
$this->variables['return_value'] = $returnValue;
$returnValue = new Variable('variable', 'return_value_ptr', $compilationContext->currentBranch);
$returnValue->setIsInitialized(true, $compilationContext, array());
$returnValue->increaseUses();
$this->variables['return_value_ptr'] = $returnValue;
}
示例2: __construct
/**
* SymbolTable
*
* @param CompilationContext $compilationContext
*/
public function __construct(CompilationContext $compilationContext)
{
/* The variables are registered in branch 1, which is the external branch */
$this->compilationContext = $compilationContext;
$this->branchVariables[1] = array();
/* this_ptr */
$thisVar = new Variable('variable', 'this', $compilationContext->currentBranch);
$thisVar->setIsInitialized(true, $compilationContext, array());
$thisVar->increaseUses();
$thisVar->setReadOnly(true);
$thisVar->setLowName('this_ptr');
$thisVar->setDynamicTypes('object');
$this->branchVariables[1]['this'] = $thisVar;
$returnValue = new Variable('variable', 'return_value', $compilationContext->currentBranch);
$returnValue->setIsInitialized(true, $compilationContext, array());
$returnValue->increaseUses();
$this->branchVariables[1]['return_value'] = $returnValue;
$returnValue = new Variable('variable', 'return_value_ptr', $compilationContext->currentBranch);
$returnValue->setIsInitialized(true, $compilationContext, array());
$returnValue->increaseUses();
$this->branchVariables[1]['return_value_ptr'] = $returnValue;
}
示例3: addCallStatusFlag
/**
* Add the last-call-status flag to the current symbol table
*
* @param CompilationContext $compilationContext
*/
public function addCallStatusFlag(CompilationContext $compilationContext)
{
if (!$compilationContext->symbolTable->hasVariable('ZEPHIR_LAST_CALL_STATUS')) {
$callStatus = new Variable('int', 'ZEPHIR_LAST_CALL_STATUS', $compilationContext->currentBranch);
$callStatus->setIsInitialized(true, $compilationContext, array());
$callStatus->increaseUses();
$callStatus->setReadOnly(true);
$compilationContext->symbolTable->addRawVariable($callStatus);
}
}