Inspector
final class Inspector (View source)
internal |
Inspector class.
Constants
OPERATIONS |
|
Methods
Performs a logical AND on the passed values using the &&
operator.
Performs a bitwise AND on the passed values using the &
operator.
Negates the passed value using the ~
bitwise operator.
Performs a bitwise OR on the passed values using the |
operator.
Performs a bitwise shift left on the passed values using the <<
operator.
Performs a bitwise shift right on the passed values using the >>
operator.
Performs a bitwise XOR on the passed values using the ^
operator.
Negates the passed value using the !
operator.
Performs a logical OR on the passed values using the ||
operator.
Performs a SPACESHIP on the passed values using the <=>
operator.
Performs a logical XOR on the passed values using the xor
operator.
Returns the count of a variable.
Determines whether a variable is empty or not.
Checks if $value1
and $value2
are equal using the ==
operator.
Checks if $value1
is greater than $value2
using the >
operator.
Checks if $value1
is greater than or equal to $value2
using the >=
operator.
Checks if $value1
and $value2
are identical using the ===
operator.
Checks if $value1
is less than $value2
using the <
operator.
Checks if $value1
is less than or equal to $value2
using the <=
operator.
Checks if $value1
and $value2
are not equal using the !=
operator.
Checks if $value1
and $value2
are not identical using the !==
operator.
Returns the passed value.
Details
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.
The variable can be any PHP type, the rules for counting are as follows:
- If the variable is an
array
orcountable
, 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 return1
if the variable istrue
, and0
if it isfalse
. - 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.
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 equals0
. - If the variable is a
string
, it will be trimmed and checked with PHPempty()
language construct. - If the variable is any other type, it will be checked with PHP
empty()
language construct.
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.