PEAR was historically promoted as a framework and distribution system for reusable PHP components. That historical relationship has become a liability for the P...
Functions that convert numbers from one base to another (bindec(), octdec(), hexdec(), and base_convert()) accept a string representation of a number and conver...
Formatting relative date and time values is a common requirement for user
interfaces, notifications, activity feeds, logs, you name it.
Examples include 3 days ...
Regular expressions fail, and PHP barely tells you when they do. A bad pattern or bad UTF-8 hands you false or null, the same falsy value a clean no-match gives...
PHP has no engine-level way to run code concurrently. Fibers (PHP 8.1) added the low-level
primitive, cooperative context switching, but no scheduler: deciding ...
PHP type declarations can name a scalar type such as int, float or string, but they cannot restrict a value to a specific member of that type. PHP already has t...
PHP began as a templating language - code embedded inside HTML. As the language and its ecosystem have matured, the inverse has become just as desirable: embedd...
In modern web applications, handling Personally Identifiable Information (PII) securely is a critical requirement. Developers frequently need to obfuscate or ma...
Primary constructors let a class declare its constructor parameters directly in the class header, immediately after the class name. This generalizes PHP 8.0's c...
The PHP project maintains official accounts on several social media platforms, but it has no formal policy governing those accounts. Credentials are held by ind...
For over 30 years, the PHP Project has thrived through the individual efforts of its contributors, and the RFC process has proven effective for making technical...
The PHP MySQL ecosystem is currently centered around mysqlnd, mysqli, and PDO_MySQL, which together provide a unified and efficient interface for interacting wi...
With this proposal, the entire PHP community gets immediate access to experimental features through an official php-community version of PHP, versioned in a rol...
This RFC proposes adding optional support for the crc-fast library in PHP's ext/hash extension, enabling SIMD-accelerated CRC-32 and CRC-64 computation. When en...
PHP has long supported immutable values through define() and the const keyword at the global and class scope. However, there is currently no way to declare a va...
Despite being the web's most prominent server-side language for over 30 years, PHP still lacks a proper built-in API for working with query parameters. The exis...
This RFC proposes allowing trailing boolean operators (&&, ||, and, or) in parenthesized expressions, mirroring the existing support for trailing commas in arra...
Partial Function Application enabled convenient creation of Closures that just defer to an existing function with some parameters already filled in with the rem...
Type aliases provide a mechanism to create more descriptive and readable type hints in PHP code. This RFC proposes type aliases that are resolved at compile tim...
This RFC proposes adding namespace-scoped visibility to methods and properties in PHP, using the syntax private(namespace). This allows classes within the same ...
Backed enums frequently need an indexed list of their backing values (int|string). Today this is commonly implemented in userland using a helper method or a tra...
To improve interoperability between PHP and other programming languages, and to simplify data encoding in PHP, we propose adding native support for encoding and...
The goal is to allow the tidy extension to have its own exception type, TidyException, with which can be used for the tidy(p) C api usage, thinking about this w...
PHP's type casting operators currently almost always convert values to the target type even if it cannot be represented from the original value.
For example nul...
Context Managers are a concept borrowed from Python. They provide a way to abstract out common control-flow and variable-lifetime-management patterns, leading ...
As part of the Resource to object conversion project, PHP internals developers converted curl resource types to objects. These objects do not have any methods, ...
Historically, PHP has supported both 32-bit and 64-bit environments. However, the vast majority of production deployments now use 64-bit systems. Major operatin...
The JSON extension does not offer any way to structurally validate the content except for basic
syntax checking. Being able to validate the actual structure wou...
The void type was introduced in PHP 7.1 with the Void return type RFC. The motivation for introducing this type was to specify that no value should be returned ...
Knowing the number of CPU cores can be useful in various applications. For example, in Nextcloud, we use it to limit the number of previews generated simultaneo...
PHP has a history of performing various forms of type conversions.
While most dubious cases of such conversions nowadays throw a TypeError,
or at least emit an ...
PHP internally marks some classes as not fit for serialization using a flag ZEND_ACC_NOT_SERIALIZABLE which prevents instances of such classes from being serial...
This RFC proposes to add a new get_declared_enums() function in the next PHP 8.x release and to make the behaviour of the related functions consistent by:
When calling functions from the global namespace, the PHP parser creates opcodes that use those functions directly. When those functions are certain built-in fu...
Currently, BCMath functions only accept values as strings. If want to calculate an int type with BCMath, need to convert it to a string once, which incurs unnec...
In PHP, initializing static properties with non-constant values often requires cumbersome workarounds that can clutter the code and reduce readability. One comm...
PHP supports accessing sub-elements of a type via an offset using brackets [] with the following notation $container[$offset].
However, the behaviour of such ac...
This RFC introduces pattern matching syntax for PHP. Pattern Matching as a language concept contains two parts: Matching a variable against a potentially compl...
Currently the way globals work forces to pass a thread-local-storage pointer across function calls, which involves some overhead. Also, not all functions get th...