BinaryComparison
in package
Table of Contents
Constants
- DELTA = 1.0E-13
- Epsilon Precision used for comparisons in calculations.
Methods
- compare() : bool
- equal() : bool
- evaluateComparison() : bool
- greaterThan() : bool
- greaterThanOrEqual() : bool
- lessThan() : bool
- lessThanOrEqual() : bool
- notEqual() : bool
- strcmpAllowNull() : int
- PHP8.1 deprecates passing null to strcmp.
- strcmpLowercaseFirst() : int
- Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters.
Constants
DELTA
Epsilon Precision used for comparisons in calculations.
private
mixed
DELTA
= 1.0E-13
Methods
compare()
public
static compare(mixed $operand1, mixed $operand2, string $operator) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
- $operator : string
Return values
boolequal()
private
static equal(mixed $operand1, mixed $operand2) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
Return values
boolevaluateComparison()
private
static evaluateComparison(mixed $operand1, mixed $operand2, string $operator, bool $useLowercaseFirstComparison) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
- $operator : string
- $useLowercaseFirstComparison : bool
Return values
boolgreaterThan()
private
static greaterThan(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
- $useLowercaseFirstComparison : bool
Return values
boolgreaterThanOrEqual()
private
static greaterThanOrEqual(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
- $useLowercaseFirstComparison : bool
Return values
boollessThan()
private
static lessThan(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
- $useLowercaseFirstComparison : bool
Return values
boollessThanOrEqual()
private
static lessThanOrEqual(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
- $useLowercaseFirstComparison : bool
Return values
boolnotEqual()
private
static notEqual(mixed $operand1, mixed $operand2) : bool
Parameters
- $operand1 : mixed
- $operand2 : mixed
Return values
boolstrcmpAllowNull()
PHP8.1 deprecates passing null to strcmp.
private
static strcmpAllowNull(null|string $str1, null|string $str2) : int
Parameters
- $str1 : null|string
-
First string value for the comparison
- $str2 : null|string
-
Second string value for the comparison
Return values
intstrcmpLowercaseFirst()
Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters.
private
static strcmpLowercaseFirst(null|string $str1, null|string $str2) : int
Parameters
- $str1 : null|string
-
First string value for the comparison
- $str2 : null|string
-
Second string value for the comparison