Documentation

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
bool

equal()

private static equal(mixed $operand1, mixed $operand2) : bool
Parameters
$operand1 : mixed
$operand2 : mixed
Return values
bool

evaluateComparison()

private static evaluateComparison(mixed $operand1, mixed $operand2, string $operator, bool $useLowercaseFirstComparison) : bool
Parameters
$operand1 : mixed
$operand2 : mixed
$operator : string
$useLowercaseFirstComparison : bool
Return values
bool

greaterThan()

private static greaterThan(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
$operand1 : mixed
$operand2 : mixed
$useLowercaseFirstComparison : bool
Return values
bool

greaterThanOrEqual()

private static greaterThanOrEqual(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
$operand1 : mixed
$operand2 : mixed
$useLowercaseFirstComparison : bool
Return values
bool

lessThan()

private static lessThan(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
$operand1 : mixed
$operand2 : mixed
$useLowercaseFirstComparison : bool
Return values
bool

lessThanOrEqual()

private static lessThanOrEqual(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison) : bool
Parameters
$operand1 : mixed
$operand2 : mixed
$useLowercaseFirstComparison : bool
Return values
bool

notEqual()

private static notEqual(mixed $operand1, mixed $operand2) : bool
Parameters
$operand1 : mixed
$operand2 : mixed
Return values
bool

strcmpAllowNull()

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
int

strcmpLowercaseFirst()

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

Return values
int

        
On this page

Search results