Sysbench is an open-source command line tool that enables to benchmark system by running various tests for CPU, RAM, disk I/O and database (e.g. MySQL).
This tutorial demonstrates how to...
The new keyword allows creating an instance of a class. Since PHP 8.1, the new keyword can be used in initializers (e.g. parameter default values, attribute arguments, etc.).
In versions...
Since PHP 8.1, we can use enumerations also called enums. Enum defines a custom type that contains a fixed set of related values.
Enum is declared using the enum keyword...
Since PHP 8.0, we can use named arguments. These arguments can be passed to a function or class method based on the parameter name. In PHP 8.0, combining named arguments...
Since PHP 8.0, we can use union types which allows providing two or more types for parameters, return values, and properties. The given value should be one of the specified...
PHP offers Closure::fromCallable static method which allows creating a new anonymous function also known as Closure from specified callback using the current scope.
For example, if we want to return...
PHP allows defining type declarations for parameters, return values, and properties. Since PHP 8.1, we can use never return type. It indicates that a function or class method throws an...
Since PHP 8.1, class properties can be declared as readonly. This means that class property can be initialized once and cannot be modified later. Readonly properties are declared with readonly...
XXH64 is a variant of xxHash non-cryptographic hash function that accepts a string of any length and returns a 64-bit fixed-length digest value, commonly represented as a sequence of 16...
PHP has spread operator (...) which allows unpacking arrays. When array is prefixed with spread operator, an array elements are spread in place. The spread operator can be used multiple...