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(mixed $str1, mixed $str2) : int
Parameters
$str1 : mixed

First string value for the comparison, expect ?string

$str2 : mixed

Second string value for the comparison, expect ?string

Return values
int

strcmpLowercaseFirst()

Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters.

private static strcmpLowercaseFirst(mixed $str1, mixed $str2) : int
Parameters
$str1 : mixed

First string value for the comparison, expect ?string

$str2 : mixed

Second string value for the comparison, expect ?string

Return values
int

        
On this page

Search results