Stack traces in exceptions can be useful for testing and debugging purposes. The stack trace contains the function names and parameters for each stack frame. It allows seeing what data...
PHP has OpenSSL extension that provides various functions related with cryptography, such as symmetric and asymmetric encryption and decryption, private and public key pair generation, etc.
Since PHP 8.2, we...
PHP has a function str_split that can be used to convert a string to an array. In PHP versions before 8.2, the str_split function returns an array with a single...
PHP allows to dynamically set and get class properties that are not declared in the class. Since PHP 8.2, dynamic properties are deprecated.
Let's say we have User class which...
The PHP functions utf8_encode and utf8_decode are used for converting string between ISO-8859-1 and UTF-8 encodings. Since 8.2, these functions are deprecated because they have an inaccurate name and can...
PHP provides several ways to embed variables into string. Since PHP 8.2, string interpolation when the dollar sign is placed outside the curly braces ${var} is deprecated.
Since PHP 8.2...
Composer store copies of downloaded PHP packages in the cache. It allows speeding up workflow because for the next time previously installed packages can be retrieved from the cache. Can...
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...