PHP Class Zephir\Operators\Arithmetical\ArithmeticalBaseOperator

This is the base operator for commutative, associative and distributive arithmetic operators
Inheritance: extends Zephir\Operators\BaseOperator
Mostrar archivo Open project: phalcon/zephir

Protected Properties

Property Type Description
$_literalOnly

Public Methods

Method Description
compile ( array $expression, Zephir\CompilationContext $compilationContext ) Compiles the arithmetical operation
optimizeConstantFolding ( array $expression, Zephir\CompilationContext $compilationContext ) : boolean | Zephir\CompiledExpression This tries to perform arithmetical operations Probably gcc/clang will optimize them without this optimization

Private Methods

Method Description
getDynamicTypes ( Variable $left, Variable $right ) : string Returns proper dynamic types

Method Details

compile() public method

Compiles the arithmetical operation
public compile ( array $expression, Zephir\CompilationContext $compilationContext )
$expression array
$compilationContext Zephir\CompilationContext

optimizeConstantFolding() public method

This tries to perform arithmetical operations Probably gcc/clang will optimize them without this optimization
See also: http://en.wikipedia.org/wiki/Constant_folding
public optimizeConstantFolding ( array $expression, Zephir\CompilationContext $compilationContext ) : boolean | Zephir\CompiledExpression
$expression array
$compilationContext Zephir\CompilationContext
return boolean | Zephir\CompiledExpression

Property Details

$_literalOnly protected_oe property

protected $_literalOnly