PHP provides the parse_url function, which parses a URL and returns an associative array of its components that are present. This function does not validate the URL or follow any...
Since PHP 8.5, we can use the #[NoDiscard] attribute, which can be applied to a functions or class methods. When an attribute is used, PHP checks if the function or...
PHP provides the memory_limit directive which specifies the maximum amount of memory a script is allowed to allocate. When the limit is exceeded, the execution stops immediately. The memory_limit can...
PHP provides set_exception_handler and set_error_handler functions for defining custom exception and error handlers that are invoked when an exception is not caught within a try/catch block or an error occurs...
Stack traces are useful for testing and debugging purposes. They provide a detailed snapshot of the call sequence leading up to an error, including the function names and the parameters...
PHP offers a range of filter functions, like filter_var and filter_input, to validate variables or superglobals against specified validation rules and parameters. By default, when validation fails, a filter function...
The PHP CLI (Command Line Interface) provides the --ini option, which shows the path of the loaded configuration file (php.ini) as well as the scanned configuration directories. Since PHP 8.5...
Before PHP 8.5 version, obtaining the build date and time of the PHP binary required using the phpinfo function. This approach was cumbersome because the phpinfo prints its output directly...
Since PHP 8.5, we can use the array_first and array_last functions to retrieve the first and last elements of an array. These functions serve as counterparts to array_key_first and array_key_last...
Run-time type information (RTTI) enables C++ programs to determine an object's dynamic type using features such as typeid and dynamic_cast. While RTTI is enabled by default on most toolchains, some...