Stack
Table of Contents
| $stack | The parser stack for formulae. | array |
|---|---|---|
| $count | Count of entries in the parser stack. | int |
| count() | Return the number of entries on the stack. | int |
| push() | Push a new entry onto the stack. | void |
| getStackItem() | mixed | |
| pop() | Pop the last entry from the stack. | mixed |
| last() | Return an entry from the stack without removing it. | mixed |
| clear() | Clear the stack. | void |
| __toString() | mixed |
Properties
$stack
The parser stack for formulae.
private
array
$stack
= []
$count
Count of entries in the parser stack.
private
int
$count
= ""
Methods
count()
Return the number of entries on the stack.
public
count(
)
: int
Return values
intpush()
Push a new entry onto the stack.
public
push(
$type :
mixed
, $value :
mixed
[, $reference :
mixed
= null ]
[, $storeKey :
null|string
= null ]
[, $onlyIf :
null|string
= null ]
[, $onlyIfNot :
null|string
= null ]
)
: void
Parameters
- $type : mixed
- $value : mixed
- $reference : mixed = null
- $storeKey : null|string = null
will store the result under this alias
- $onlyIf : null|string = null
will only run computation if the matching store key is true
- $onlyIfNot : null|string = null
will only run computation if the matching store key is false
getStackItem()
public
getStackItem(
$type :
mixed
, $value :
mixed
[, $reference :
mixed
= null ]
[, $storeKey :
mixed
= null ]
[, $onlyIf :
mixed
= null ]
[, $onlyIfNot :
mixed
= null ]
)
: mixed
Parameters
- $type : mixed
- $value : mixed
- $reference : mixed = null
- $storeKey : mixed = null
- $onlyIf : mixed = null
- $onlyIfNot : mixed = null
Return values
mixedpop()
Pop the last entry from the stack.
public
pop(
)
: mixed
Return values
mixedlast()
Return an entry from the stack without removing it.
public
last(
[ $n :
int
= 1 ]
)
: mixed
Parameters
- $n : int = 1
number indicating how far back in the stack we want to look
Return values
mixedclear()
Clear the stack.
public
clear(
)
: void
__toString()
public
__toString(
)
: mixed