Skip to main content

Zymba Documentation

Var

object @Var() {
clone(mixed $value): mixed {}
cloneDeep(mixed $value): mixed {}
compare(mixed $value1, mixed $value2): int {}
count(mixed $value): int {}
countGlobalVariables(): int {}
exists(mixed $value): bool {}
fromJSON(string $string): mixed {}
fromSerializedPHP(string $string): mixed {}
isBool(mixed $value): bool {}
isComplex(mixed $value): bool {}
isEmpty(mixed $value): bool {}
isFloat(mixed $value): bool {}
isFunction(mixed $value): bool {}
isInt(mixed $value): bool {}
isNull(mixed $value): bool {}
isNumber(mixed $value): bool {}
isNumeric(mixed $value): bool {}
isObject(mixed $value): bool {}
isScalar(mixed $value): bool {}
isString(mixed $value): bool {}
isValidJSON(string $string): bool {}
listGlobalVariables(): object {}
listGlobalVariableNames(): object {}
pack(string $format, ...$arguments): string {}
toJSON(mixed $value): string {}
toPrettyJSON(mixed $value): string {}
toSerializedPHP(mixed $value): string {}
typeOf(mixed $value): string {}
unpack(string $format, string $string): object {}
}

Static variable related functions.

Functions

Clones the value by creating a shallow copy.

@Var.clone(mixed $value): mixed
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
mixed

Clones the value by creating a deep copy.

@Var.cloneDeep(mixed $value): mixed
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
mixed

Compares two values.

@Var.compare(mixed $value1, mixed $value2): int
Parameters
NameTypeValueDefault
value1mixednull
value2mixednull
Returns
TypeValue
int+1
int-1
int0

Counts the total number of intrinsic constituents of a value.

@Var.count(mixed $value): int
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
int

Counts the total number of global variables.

@Var.countGlobalVariables(): int
Returns
TypeValue
int

Determines whether a value exists, meaning is not null.

@Var.exists(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Returns the value corresponding to a JavaScript Object Notation (JSON) representation according to RFC 4627.

@Var.fromJSON(string $string): mixed
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
mixed

Returns the value corresponding to a serialized PHP representation.

@Var.fromSerializedPHP(string $string): mixed
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
mixed

Determines whether a value is of type "bool", meaning either true or false.

@Var.isBool(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is of a complex type.

@Var.isComplex(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is empty, meaning either null, an empty string or an empty object.

@Var.isEmpty(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is of type "float".

@Var.isFloat(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is of type "function".

@Var.isFunction(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is of type "int".

@Var.isInt(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is null.

@Var.isNull(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is a number, meaning of type "int" or "float".

@Var.isNumber(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is numeric, meaning a number or the string representation thereof.

@Var.isNumeric(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is of type "object".

@Var.isObject(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is of a scalar type, meaning all primitive non-composite types.

@Var.isScalar(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a value is of type "string".

@Var.isString(mixed $value): bool
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
bool

Determines whether a string represents a valid JavaScript Object Notation (JSON) representation according to RFC 4627.

@Var.isValidJSON(string $string): bool
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
bool

Lists all variables of global scope.

@Var.listGlobalVariables(): object
Returns
TypeValue
object[name: value, ...]

Lists all variable names of global scope.

@Var.listGlobalVariableNames(): object
Returns
TypeValue
object[name, ...]

Packs variadic arguments into binary data according to a specific Perl/PHP-compatible format.

@Var.pack(string $format, variadic $arguments): string
Parameters
NameTypeValueDefault
formatstring""
argumentsvariadic...
Returns
TypeValue
string

Returns the JavaScript Object Notation (JSON) representation of a value according to RFC 4627.

@Var.toJSON(mixed $value): string
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
string

Returns the JavaScript Object Notation (JSON) representation of a value according to RFC 4627 in human-readable form.

@Var.toPrettyJSON(mixed $value): string
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
string

Returns the serialized PHP representation of a value.

@Var.toSerializedPHP(mixed $value): string
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
string

Returns the type of a value.

@Var.typeOf(mixed $value): string
Parameters
NameTypeValueDefault
valuemixednull
Returns
TypeValue
string

Unpacks values from binary data according to a specific Perl/PHP-compatible format.

@Var.unpack(string $format, string $string): object
Parameters
NameTypeValueDefault
formatstring""
stringstring""
Returns
TypeValue
object[value, ...]