PHP supports positional arguments. It means that we need to pass these arguments to a function or method based on the parameter position. The order of these arguments are important...
A non-static method is a method that belongs to an instance of a class. In all PHP 7 versions, calling non-static methods statically is deprecated and emits a warning (E_DEPRECATED...
PHP allows using a trailing comma for the last item in the array. It's for convenience because we can add another element to the array without modifying the last line...
In versions prior to PHP 8.0, the precedence of concatenation (.), + and - operators are equal, and these operators are evaluated from left to right.
Consider the following line...
Checking whether a string starts or ends with a given substring are very common tasks. In versions prior to PHP 8.0, this functionality can be implemented using various string functions...
In versions prior to PHP 8.0, in order to catch an exception, we need to store it in a variable. However, there can be situations when variable is not used...
PDO is a PHP extension that provides a uniform way to access various databases (MySQL, PostgreSQL, etc.). PDO supports three different error modes. Error mode defines how PDO should behave...
In versions prior to PHP 8.0, in order to check if a string contains a given substring, we can use the strpos function. This function returns the position of the...
Since PHP 5.5, we can use the special ::class constant which allows getting a fully qualified name (FQN) of the class by using ClassName::class syntax.
Let's say we have a...
SHA-512 is a cryptographic hash function that accepts a string of any length and returns a 512-bit fixed-length digest value, commonly represented as a sequence of 128 hexadecimal digits. SHA-512...