PHP has date and time format specifier P that returns the time zone offset such as +02:00, -05:00, etc. An offset of +00:00 for UTC can also be represented as...
Debugging is an important part of the software developing, which usually requires working with stack traces. A stack trace is a list of the function and method calls that generated...
Properties are class member variables that store values like strings, integers, boolean, etc. We can set properties via class constructor, setter method or directly if property is public.
When we...
The SplObjectStorage class allows storing additional data about objects. Objects are stored as keys and associated data as values. In other words, this class allows creating a map from objects...
Array elements and string offsets can be accessed using square bracket [] syntax. There is also curly brace {} syntax, which is rarely used in practice. Since PHP 7.4, curly...
Autoloading is a process to automatically load classes and interfaces without using include, include_once, require, or require_once statements at the beginning of each PHP file. The __autoload is a function...
PHP has disable_functions directive that allows to specify functions which should be disabled. This commonly used to disable unsafe functions for security reasons.
The disable_functions directive can be set in...
Null is a type that has only one possible value null. The null value indicates that the variable doesn't have a value. However, due to null value, we might need...
PHP has the gettype function that allows to get the type of variable. This function can be useful for debugging, testing, creating error messages, etc.
Since PHP 8.0, we can...
The token_get_all function parses PHP source code and returns an array of tokens. Each token is represented either as a single character or an array that contains token ID, token...