When iterating with foreach, it is not possible to retrieve only the keys (and not also the values) without unnecessary extra work or semantic overhead. This RF...
As part of the Resource to object conversion project,
the cURL resource types were converted to objects with the release of PHP 8.0 . Currently, those objects
...
Some classes aren't supposed to be serialized. Currently, while PHP internal classes have a nice way of preventing being serialized/unserialized, userspace does...
This RFC proposes to remove or at least minimise the distinction between typed and untyped properties, by treating any property with no type information as thou...
The disable_classes INI setting is fundamentally useless and causes various issues in the engine, as using it will result in unexpected states for the engine to...
Currently, the main way used to call a closure from within that closure, is to bind a variable by reference into the closure, when the closure is created.
PHP currently contains two data types which are copy-on-write (CoW): string and arrays. When you pass a variable containing a CoW type as an argument to a funct...
During PHP execution, it is possible to reflect on most of the code currently running. For example, it is easy to get the name of a class and using reflection u...
This RFC proposes the addition of an inline syntax for lexical (captured) variables when declaring anonymous classes in PHP. The goal is to simplify anonymous c...
This RFC proposes the addition of a syntax that allows closures to declare one or more interfaces they implement. This would provide developers with a more expl...
This RFC proposes a new method for the Closure class called castTo(). This method would allow developers to create an instance of a class that implements a spec...
This RFC proposes to introduce structural typing for closures when used with interfaces containing only an __invoke() method. This feature aims to simplify the ...
PHP has had support for class autoloading since PHP 5 and it is an extremely useful feature that is relied on to only load classes that are being used within th...
In general, PHP userland is not very good at or at least not consistent at exposing/accessing Zend engine internals. This occurs both at the userland function ...
UTF-8 is the most popular character set encoding globally on the web. Approximately 95% of all websites use it. PHP powers approximately 77.4% of the dynamic ...
PHP has traditionally been weak in the area of mathematics and math operations beyond what the baseline C library supplies. With the growth of machine learning...
When working with larger images in gd, exporting and importing pixels one pixel/color at a time with imagecolorat() and imagesetpixel() creates a lot of functio...
When using magic methods to access actual properties, respecting their declared visibility is often desired. Yet, accessing the calling scope to emulate the vis...
Zend engine has the policy of performing copy-on-write for every string operation. This means that memory is regularly allocated and deallocated and strings ar...
When dealing with I/O in PHP, one deals with streams as an abstraction over the file system. This abstraction is convenient in giving a uniform interface withou...
While random number generation in PHP has been improved by a series of Random Extension RFCs, the old insecure methods remain, and need to be migrated to a more...
This RFC suggests to introduce a new class to make using and processing
(Unicode) text significantly more developer friendly compared to the
wealth of functiona...
The array_unique() function allows getting all unique values of a given array. Unfortunately, PHP has multiple
definitions of equality and thus uniqueness. The ...
The support for the SameSite cookie attribute has been added in PHP 7.3.
However, it can only be set by passing an array of options with the samesite key define...
With the advent of standards promoting quasi-immutable objects, like PSR-7, wither methods became increasingly widely used. This practice is the de facto standa...
The shell_exec() function is used to execute an external program and grab its entire output as a string, but it lacks a way to capture the exit code of the laun...
While SplDoublyLinkedList and its subclass SplQueue/SplStack exist in the SPL, they have several drawbacks (that are addressed by this RFC to add a Deque class)...
PHP's native array type is rare among programming language in that it is used as an associative map of values, but also needs to support lists of values.
In ord...
This RFC proposes to add a built-in Enumeration to PHP to specify the possible return values of sorting/comparison functions. This enumeration would be easier ...
PHP has a user_agent php.ini entry for decades, which can be set as a default value. But it is considered for stream based operations like file_get_contents. Th...
PHP is a dynamically typed language and as such implicit type coercion naturally arises, most of these are harmless and rather convenient. However, the conversi...
SPL provides a set of iterators that allow feeding one into another to create powerful data pipelines, however doing that is not particularly convenient:
Currently, autoloading requires invoking a userland function that is then responsible for performing its own logic to determine the class location on disk, and ...
Knowing if a query you ran generated warnings in your database is very important. MySQL warns about values getting truncated, inserting nulls into not-null colu...
As we all know mysqli was created as a replacement for the old mysql_* API. The core improvements over the old API were: support for prepared statements, object...
The match() expression, introduced in PHP 8.0, matches one value against a series of others. For more complex cases, it's possible to provide a value of boolea...
This RFC expands on the previous Enumerations RFC to allow values to be associated with an enum Case, creating what is typically called a tagged union.
This is an over-arching description of a multi-step process to add Algebraic Data Types to PHP. That effort is happening over multiple implementation RFCs in o...
This RFC introduces a new interface Falsifiable and magic method __toBool() allowing custom objects (types) to define and declare themselves true or false. Give...
The word blacklist require additional context to figure out the exact intention of a specific
configuration. This proposal suggest to change this to a name that...
Most generally, this is a syntactical change that (IMO, of course) allows for a terser and more expressive way to achieve conditional returns (along with breaks...
The RFC proposes to unbundle or assign the PHP Project as a maintainer for the listed extension in PHP 8 following the Cleaning up unmaintained extensions RFC.
This RFC proposes to change var_export()'s array syntax to use the new short-hand arrays first introduced in PHP 5.4. The old array() construct is a kludge and ...
To allow for more strictness and type safety if a user wishes to have it, we need a way to make variable declarations explicit. When enabled, accessing an undec...
PHP supports expression casting to primitive type (like int) by using ( type ) expression, but it currently doesn't allow to use a nullable type as introduced b...
This RFC proposes a new syntax for compact generator creation, or comprehensions as they are known in many other languages. Such a syntax offers a more compact...
This RFC proposes to change in part void 's behavior in class methods; the current behavior is causing more annoyance than benefit and is probably too restricti...
Namespace visibility modifiers, in one shape or another (or by other names), have been a topic of discussion in the PHP community for more than a decade (ever s...
Some procedures are capable of accepting or returning any type of the ones that are considered scalar. PHP does not have support for union types and the only wa...
Scalar type declarations use only a single name for each numeric type, but casts permit some variation. This RFC proposes to deprecate the variants that are not...
By-reference parameters are currently only declared when defining a function, while the call-site does not distinguish between by-value and by-reference passing...
Fibers are primitives for implementing light weight cooperative concurrency in PHP. Basically they are a means of creating Closure that can be paused and resume...
uniqid(), against all expectations from the name, doesn't produce unique IDs. While there is a sleep() to prevent multiple duplicate IDs in the same process, th...
PHP 7.0 introduced strict type checking as part of the scalar types RFC. When enabled, PHP will use strict type-checking mode for function calls and return sta...
Disallow multiple calls to an objects constructor to ensure that the encapsulated data cannot be mutated even if an object is meant to be immutable. The goal is...
This RFC proposes a syntax change to allow arbitrary chaining together of comparison and equality operations [==, !=, !==, ===, =]. The initial request that sp...
Currently setLocation() returns old location when called, but if new one is not provided it will unset location property.Adding a getLocation is a practical way...
As of 2016-01-01, the CA/B Forum forbids issuing new SHA-1 certificates. The CA/B has advised CAs starting 2015-01-16 to issue no SHA-1 certificates with an exp...
This RFC came about for an attempt to resolve Bug #72811. In the attempt, discussion shifted from trying to patch the current implementation of parse_url() to ...
The internal DateTime and ImmutableDateTime classes have an internal compare_objects() method, which allows them to be directly compared with the usual comparis...
PHP 7 introduced the strict_types declare directive, which controls how scalar type declarations behave in a certain file. A common complaint is that this direc...
PHP allows multiple statements that define the same constant, they are executed at run-tinw and only the first one actually define the constant value. Others ju...
This RFC proposes the introduction of simple value annotations - arbitrary values attached to classes and class members as meta-data, obtainable via reflection.
CSRF (Cross Site Request Forgery) has been major vulnerability for PHP applications. CSRF protection is not difficult to implement especially with good web appl...
A common PHP OOP pattern is the use of method chaining, or what is also known as Fluent Expressions. So named for the way one method flows into the next to form...
Currently, when you typehint against callable in your method signatures, you can never be certain whether it accepts the parameters you are giving it or if the ...
Most binary expressions in PHP (e.g. `$x = $y op $z;`) have a shorthand form for self assignment (where the lefthand of the binary op is the same as the lefthan...
Currently in PHP, the constructor methods of classes can only be directly invoked through the language construct of 'new', they cannot be called as a callable v...
token_get_all() returns an array of tokens where each token element is either a single-character (for single-character tokens), or an array describing the token...
PHP variable serialization was source of security issues. The root cause of issues is crafted serialized data. Crafted serialized data can be rejected by messag...
We could destruct variables from an array with list constuct, it may be nested or a simple array. But there is no guarantee that the array can fulfill all vari...
Objects are stateful by the state of all of their non-static and static properties. The same is for classes themselve for being stateful by the state of all of ...
PHP is weakly typed to make it work with Web smoothly. However, precise data type usage is more an more important in these days. Weakly typed does not mean type...
First of all, this RFC will not remove any old function names. This RFC only proposes renaming offending function names and have aliases for old names. Old name...
When allow_url_include was introduced, it was good enough protection against remote script inclusion. However, it causes problem for local script inclusion prot...
For more than 10 years (since PHP 5 was released), the PHP core community has
seen a lot of discussions about strict vs loose typing, type hinting and
related f...
PHPs GitHub repository has over 180 open pull requests. Many of these are bug fixes or new tests that should be incorporated into PHP, but have not been because...
In PHP on comparing two strings in non-strict mode both operands will be casted to numbers and if it succeed both numbers will be compared instead of a binary s...
This RFC proposes the introduction of an Abstract Syntax Tree (AST) as an intermediary structure in our compilation process. This replaces the existing practice...
This RFC proposes improvements to the way we handle type information in reflection. This work will make it easier for writing tools that convert type informatio...
Crypt source such as /dev/urandom is mandatory for secure programs. None the less, PHP does not have way to specify crypt source as a core. This RFC proposes 2 ...
Was asked at PHPBenelux about being able to tell what PHP version a given module is loadable in (given only the .so). Since the answer came down to Try it and ...
@yohgaki suggested adding support for libgmp's arbitrary precision floating point numbers to the PHP extension, and I offered to implement it, so here's my prop...
Named arguments allow passing arguments to a function based on the parameter name, rather than the parameter position. This makes the meaning of the argument se...
The purpose of this RFC is to make unset return something meaningful. People also shouldn't have to wonder why they can't use unset if it isn't as a standalone ...
This RFC talks about integration of voting polls into PHP.net in order to get a feedback from PHP users on RFCs or other topics from things like expectations fr...
Linux distributions with systemd support a socket activation feature that allows systemd to listen on the socket from early in the boot process and start the se...
This RFC proposes the addition of an SPL class (and optionally a set of functions) dedicated to the secure escaping of untrusted values against Cross-Site Scrip...
The purpose behind this RFC is to introduce converting the DateTime object to a string representation. This is a commonly requested feature in bug reports (the ...
This RFC proposes the addition of a set of two new functions that simplify working with arrays containing a set of unique values or objects that do not have any...
Performing a set of actions upon *not* entering a loop is a very common programming necessity. This RFC proposes an optional else clause that can be used after ...
The purpose of this RFC is to introduce the idea of using Jenkins for Continuous Integration in the PHP project supported with a Proof of concept implementation...
Past discussions on the mailing lists have shed some light on the various ways we handle prototype checks and what may be done to improve PHP in that area.
This...
Currently, anything which generates PHP from other input files of any kind must cope with the line numbers and file names in the resulting PHP file being potent...
The topic of supporting function autoloading was brought up many times in the past, this RFC introduces a potential implementation which would be consistent wit...
Converting strings to doubles is a common problem in applications. The current standard in solving this problem
is David Gays strtod algorithm. This algorithm i...
Many languages currently support metadata information. This RFC exposes an idea about how can it be implemented in PHP, providing a powerful tool that many appl...
This proposal proposes to introduce the ability for automagically defining missing definitions at run time.
The reader should have a reasonable level of PHP kno...
The purpose of this RFC is proposing to remove the requirement of T_FUNCTION keyword in method declarations if a visibility flag (T_PUBLIC,T_PROTECTED, T_PRIVAT...
Many other languages offer the ability to provide a method on a class which will be used when instances of that class are compared via comparison or equality op...
Every error in PHP is formatting in a sprintf()-alike syntax using one of our many error handling functions, every time an error, warning or notice occurs, we h...
Autoboxing is a language feature that enables just-in-time conversion of a value object to another kind that is suitable to the context where it happens. In ge...
sql.safe_mode is a very old feature of PHP, not really maintained and barely understood. The documentation claims on http://php.net/manual/en/ini.core.php#ini.s...
The current state of JSON support in PHP deals with all scalar types smoothly. However, complex data structures cannot be handled by PHP API.
This proposal want...
php_error(), zend_throw_exception(), the @-operator... PHP and/or the Zend Engine respectively offer a variety of error issuance and handling mechanisms. There ...
Currently, PHP's interpreter, the Zend Engine, provides access to its internals via the Zend API. This RFC provides a rationale for this access, by removing the...
PHP's current bench.php is a micro-benchmark which tests a number of language features. Since it does not behave like a 'real' application, it cannot provide me...
Currently the Zend Engine provides some magic to methods in classes with defined names, for example __toString() is called when someone attempts to cast a class...
Static classes are a well known construct for utility classes or stateless abstraction. C# for example has an class System.Environment to access command line op...
The purpose of this RFC is to propose adding functionality to Reflection which will augment Reflection::getDocComment() with a new function that will parse the ...
PDO is a thin layer above native RDBMS interfaces. As such its focused on providing a unified API on the PHP level without getting too much into SQL abstraction...
There are several extensions that replaces the internal PHP error callback (zend_error_cb, initially set to php_error_cb), either to customize one of the behavi...
Some applications require cryptographically secure random data to perform security functions. This RFC proposes a solution to the PHP programmer's difficulties ...
In PHP 7.0, the assert statement received some enhancements. Notably, it added the ability to throw exceptions on failures (but off by ini default) and the code...
HTTP session management is core of Web security. Current default of session module options are weaker than it could be. Secure values by default would be better...
Currently, the Zend Engine exposes several methods to PECL extensions and internal classes to control how internal objects behave when casting to primitives. T...
Weak references is an established concept in many existing object oriented languages such as Java, C#, Python and Lisp, and has been so for many years. [1] A we...
This is a preliminary implementation of support for tainted variables in PHP. The goal is to help PHP application programmers find and eliminate opportunities f...
uniqid() is supposed to create unique ID based on time. Current implementation does not make
sure uniqueness of result because it relies on system time.