PHP Class Zephir\Optimizers\EvalExpression

Resolves evaluation of expressions returning a C-int expression that can be used by 'if'/'while'/'do-while' statements
ファイルを表示 Open project: phalcon/zephir Class Usage Examples

Protected Properties

Property Type Description
$_unreachable
$_unreachableElse
$_usedVariables

Public Methods

Method Description
getEvalVariable ( ) : Variable Returns the variable evaluated by the EvalExpression
getUsedVariables ( ) : array
isUnreachable ( ) : boolean Checks if the evaluation produce unreachable code
isUnreachableElse ( ) : boolean Checks if the evaluation not produce unreachable code
optimize ( $exprRaw, Zephir\CompilationContext $compilationContext ) : boolean | string Optimizes expressions
optimizeNot ( array $expr, Zephir\CompilationContext $compilationContext ) : boolean | string Skips the not operator by recursively optimizing the expression at its right

Method Details

getEvalVariable() public method

Returns the variable evaluated by the EvalExpression
public getEvalVariable ( ) : Variable
return Zephir\Variable

getUsedVariables() public method

public getUsedVariables ( ) : array
return array

isUnreachable() public method

Checks if the evaluation produce unreachable code
public isUnreachable ( ) : boolean
return boolean

isUnreachableElse() public method

Checks if the evaluation not produce unreachable code
public isUnreachableElse ( ) : boolean
return boolean

optimize() public method

Optimizes expressions
public optimize ( $exprRaw, Zephir\CompilationContext $compilationContext ) : boolean | string
$exprRaw
$compilationContext Zephir\CompilationContext
return boolean | string

optimizeNot() public method

Skips the not operator by recursively optimizing the expression at its right
public optimizeNot ( array $expr, Zephir\CompilationContext $compilationContext ) : boolean | string
$expr array
$compilationContext Zephir\CompilationContext
return boolean | string

Property Details

$_unreachable protected_oe property

protected $_unreachable

$_unreachableElse protected_oe property

protected $_unreachableElse

$_usedVariables protected_oe property

protected $_usedVariables