Before PHP 8.5, working with immutable objects or readonly classes required a somewhat verbose pattern to create modified copies of existing objects. Since readonly properties cannot be changed after construction...
PHP provides the curl_share_init function, which enables sharing certain types of data between the Curl handles. By using a shared handle, multiple requests can reuse resources such as DNS lookups...
MySQLi extension provides the mysqli_execute function, which is an alias of mysqli_stmt_execute function. The name mysqli_execute is misleading, because the function operates on mysqli_stmt objects rather than on mysqli connection...
Before PHP 8.0, the function curl_close was used to close the Curl resource created by using the curl_init function. Since PHP 8.0, the curl_close function has no effect because curl_init...
The OPcache extension boosts PHP performance by caching precompiled script bytecode in memory, removing the need to load and parse scripts on every request. OPcache has become a crucial part...
In PHP, the scalar type casting can be used to convert a value to a specific type by placing the desired type in parentheses before the value. PHP has long...
PHP provides several functions for executing shell commands directly from a script. It also supports the backtick operator - known as the execution operator - which runs a command and...
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...