final class Inspector (View source)

internal  
 

Inspector class.

Constants

OPERATIONS

Methods

static bool
doAnd(mixed $value1, mixed $value2)

Performs a logical AND on the passed values using the && operator.

static int
doBitwiseAnd(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise AND on the passed values using the & operator.

static int
doBitwiseNegate(null|bool|int|float|string $value)

Negates the passed value using the ~ bitwise operator.

static int
doBitwiseOr(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise OR on the passed values using the | operator.

static int
doBitwiseShiftLeft(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise shift left on the passed values using the << operator.

static int
doBitwiseShiftRight(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise shift right on the passed values using the >> operator.

static int
doBitwiseXor(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise XOR on the passed values using the ^ operator.

static bool
doNegate(mixed $value)

Negates the passed value using the ! operator.

static bool
doOr(mixed $value1, mixed $value2)

Performs a logical OR on the passed values using the || operator.

static int
doSpaceship(mixed $value1, mixed $value2)

Performs a SPACESHIP on the passed values using the <=> operator.

static bool
doXor(mixed $value1, mixed $value2)

Performs a logical XOR on the passed values using the xor operator.

static int|float
getCount(mixed $variable)

Returns the count of a variable.

static bool
isEmpty(mixed $variable)

Determines whether a variable is empty or not.

static bool
isEqual(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are equal using the == operator.

static bool
isGreaterThan(mixed $value1, mixed $value2)

Checks if $value1 is greater than $value2 using the > operator.

static bool
isGreaterThanOrEqual(mixed $value1, mixed $value2)

Checks if $value1 is greater than or equal to $value2 using the >= operator.

static bool
isIdentical(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are identical using the === operator.

static bool
isLessThan(mixed $value1, mixed $value2)

Checks if $value1 is less than $value2 using the < operator.

static bool
isLessThanOrEqual(mixed $value1, mixed $value2)

Checks if $value1 is less than or equal to $value2 using the <= operator.

static bool
isNotEqual(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are not equal using the != operator.

static bool
isNotIdentical(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are not identical using the !== operator.

static mixed
return(mixed $value)

Returns the passed value.

Details

static bool doAnd(mixed $value1, mixed $value2)

Performs a logical AND on the passed values using the && operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static int doBitwiseAnd(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise AND on the passed values using the & operator.

Parameters

null|bool|int|float|string $value1
null|bool|int|float|string $value2

Return Value

int

static int doBitwiseNegate(null|bool|int|float|string $value)

Negates the passed value using the ~ bitwise operator.

Parameters

null|bool|int|float|string $value

Return Value

int

static int doBitwiseOr(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise OR on the passed values using the | operator.

Parameters

null|bool|int|float|string $value1
null|bool|int|float|string $value2

Return Value

int

static int doBitwiseShiftLeft(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise shift left on the passed values using the << operator.

Parameters

null|bool|int|float|string $value1
null|bool|int|float|string $value2

Return Value

int

static int doBitwiseShiftRight(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise shift right on the passed values using the >> operator.

Parameters

null|bool|int|float|string $value1
null|bool|int|float|string $value2

Return Value

int

static int doBitwiseXor(null|bool|int|float|string $value1, null|bool|int|float|string $value2)

Performs a bitwise XOR on the passed values using the ^ operator.

Parameters

null|bool|int|float|string $value1
null|bool|int|float|string $value2

Return Value

int

static bool doNegate(mixed $value)

Negates the passed value using the ! operator.

Parameters

mixed $value

Return Value

bool

static bool doOr(mixed $value1, mixed $value2)

Performs a logical OR on the passed values using the || operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static int doSpaceship(mixed $value1, mixed $value2)

Performs a SPACESHIP on the passed values using the <=> operator.

Parameters

mixed $value1
mixed $value2

Return Value

int

static bool doXor(mixed $value1, mixed $value2)

Performs a logical XOR on the passed values using the xor operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static int|float getCount(mixed $variable)

Returns the count of a variable.

The variable can be any PHP type, the rules for counting are as follows:

  • If the variable is an array or countable, the method will return the number of elements in it.
  • If the variable is an object, the method will count of the accessible non-static properties of it.
  • If the variable is a boolean, the method will return 1 if the variable is true, and 0 if it is false.
  • If the variable is an integer, the method will return the number itself.
  • If the variable is a float or a numeric string, the method will cast it to a float and returns it.
  • If the variable is a string or any other type, the method will cast it to a string and returns the length of it after trimming.

Parameters

mixed $variable

Return Value

int|float

static bool isEmpty(mixed $variable)

Determines whether a variable is empty or not.

The variable can be any PHP type, the check is done as follows:

  • If the variable is a boolean or numeric (integer, float, string), it is not considered empty even if its value equals 0.
  • If the variable is a string, it will be trimmed and checked with PHP empty() language construct.
  • If the variable is any other type, it will be checked with PHP empty() language construct.

Parameters

mixed $variable

Return Value

bool

static bool isEqual(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are equal using the == operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static bool isGreaterThan(mixed $value1, mixed $value2)

Checks if $value1 is greater than $value2 using the > operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static bool isGreaterThanOrEqual(mixed $value1, mixed $value2)

Checks if $value1 is greater than or equal to $value2 using the >= operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static bool isIdentical(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are identical using the === operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static bool isLessThan(mixed $value1, mixed $value2)

Checks if $value1 is less than $value2 using the < operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static bool isLessThanOrEqual(mixed $value1, mixed $value2)

Checks if $value1 is less than or equal to $value2 using the <= operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static bool isNotEqual(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are not equal using the != operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static bool isNotIdentical(mixed $value1, mixed $value2)

Checks if $value1 and $value2 are not identical using the !== operator.

Parameters

mixed $value1
mixed $value2

Return Value

bool

static mixed return(mixed $value)

Returns the passed value.

Parameters

mixed $value

Return Value

mixed