package BackPress

 Methods

Constructor.

__construct(string $str) 
since 4.9.0

Parameters

$str

string

Plural function (just the bit after plural= from Plural-Forms)

Execute the plural form function.

execute(integer $n) : integer
since 4.9.0

Parameters

$n

integer

Variable "n" to substitute.

Returns

integerPlural form value.

Get the plural form for a number.

get(integer $num) : integer

Caches the value for repeated calls.

since 4.9.0

Parameters

$num

integer

Number to get plural form for.

Returns

integerPlural form value.

Parse a Plural-Forms string into tokens.

parse(string $str) 

Uses the shunting-yard algorithm to convert the string to Reverse Polish Notation tokens.

since 4.9.0

Parameters

$str

string

String to parse.

 Properties

 

Cache for repeated calls to the function.

$cache : array

Default

array()
since 4.9.0
 

Operator precedence.

$op_precedence : array

Default

array('%' => 6, '<' => 5, '<=' => 5, '>' => 5, '>=' => 5, '==' => 4, '!=' => 4, '&&' => 3, '||' => 2, '?:' => 1, '?' => 1, '(' => 0, ')' => 0)
Static

Operator precedence from highest to lowest. Higher numbers indicate higher precedence, and are executed first.

see
since 4.9.0
 

Tokens generated from the string.

$tokens : array

Default

array()
since 4.9.0

 Constants

 

Valid number characters.

NUM_CHARS = '0123456789' : string
since 4.9.0
 

Operator characters.

OP_CHARS = '|&><!=%?:' : string
since 4.9.0