-
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...
-
Left-to-right assignment operator can be used to reduce congnitive complexity when using long chain of pipe operators.
-
PHP has historically adopted a shared-nothing architecture that
frees all request-scoped userland memory at the end of each request.
-
Class autoloading has existed in PHP for 20+ years. However, there is no equivalent for function autoloading.
-
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...
-
PHP 8.5 allowed closures inside constant expressions: anonymous static function () {} and
first-class callables foo(...), in attribute arguments and parameter d...
-
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...
-
PHP has three visibility levels
-
This RFC proposes a variant of closures for the common case of a callback that runs inside its defining function.
-
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 to prevent instantiation and cloning of the internal class __PHP_Incomplete_Class.
-
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...
-
Piping result of expression to return keyword can be used to reduce congnitive complexity.
-
PHP's type conversion system contains differences between explicit casts and scalar type checks. This RFC addresses two issues:
-
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 ...
-
Serialization is a fundamental PHP mechanism that allows objects to be converted into a storable or transferable representation.
-
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...
-
The zend.exception_ignore_args INI setting was introduced in PHP 7.4.0 and allows arguments to be excluded from stack traces generated for exceptions.
-
Integrating zstd (Zstandard) and brotli compression formats into PHP's core would significantly enhance the language's data compression capabilities.
-
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...
-
This RFC proposes a slate of minimum supported software versions for PHP 8.6.
-
The accepted Partial Function Application RFC proposed inheriting the optionality of ?-placeholdered parameters. This results in inconsistent user-facing behavi...
-
Three ini settings in PHP's session extension have security implications but ship with defaults that leave applications unnecessarily exposed. This RFC proposes...
-
This RFC proposes to improve the functionality of the SNMP extension in one or more of the following ways:
-
This RFC proposes extending the endianness modifier syntax (< and >) to floating-point format codes in PHP's pack() and unpack() functions.
-
This RFC proposes adding support for signed integers with specific endianness to PHP's pack() and unpack() functions using Perl's endianness modifier syntax. Th...
-
This RFC proposes adding comprehensive TLS session resumption support to PHP's OpenSSL stream
implementation. Session resumption is a critical performance optim...
-
This RFC proposes a set of follow-up improvements to the URL Parsing API RFC. It extends the Uri\Rfc3986\Uri and Uri\WhatWg\Url classes with additional capabili...
-
The RFC proposes to deprecate the listed functionality in PHP 8.6 and remove it in PHP 9 (except where otherwise noted).
-
In modern software development, value semantics is a crucial concept that treats objects based on their content rather than their identity. Unlike traditional r...
-
The RFC proposes to deprecate the listed functionality in PHP 8.5 and remove it in PHP 9 (except where otherwise noted).
-
The GMP class was introduced as part of the
Internal operator overloading and GMP improvements
RFC.
-
This RFC proposes to change how JIT is disabled by default.
-
Resources are a legacy data structure which were superseded by objects a long time ago. They have quite a few disadvantages like the inability of using resource...
-
The first version of JIT for PHP was released in PHP-8.0 (https://wiki.php.net/rfc/jit). That time we took a quite simple approach. We are generating native cod...
-
The RFC proposes to deprecate the listed functionality in PHP 8.4 and remove it in PHP 9 (except where otherwise noted).
-
PHP's current error reporting in unserialize() is very inconsistent, making it hard to reliably handle errors that occur during unserialization.
-
PHP now has support for null and false as standalone types.
However, true which is the natural counter part of false does not even exist as a type.
-
Undefined properties are those that have not yet been defined either by the presence of a property declaration, or by adding them to the properties hashmap thro...
-
Undefined variables are those that have not yet been initialised with a value prior to being read. Accessing an undefined variable currently emits an E_WARNING ...
-
Disjunctive Normal Form (DNF) is a standard way of organizing boolean expressions. Specifically, it means structuring a boolean expression into an ORed series ...
-
Locale-sensitivity is almost always a bug. In the interests of making it easy to write correct code, and to improve performance, strtolower() and related functi...
-
PHP 8.1 added support for readonly properties via PHP RFC: Readonly properties 2.0. However, it's still not easy to declare (quasi-)immutable classes, especiall...
-
Despite the huge efforts put into improving the type system of PHP year after year, it is still not possible to declare constant types. This is less of a concer...
-
PHP has provided over the years different ways to indicate the beginning of PHP code other than the standard open tags. Most of these opening tags have been re...
-
As arrays are a powerful data structure it's handy in some cases to get the first or the last key/value of an array without a workaround. To accomplish this tas...
-
The national character type was introduced in SQL-92 (section 4.2.1). It's an open-ended type. The spec indicates that its meaning is defined by the implementat...
-
Since PHP5, objects have been the preferred structure for wrapping internal data, however some clod created the hash extension to use resources. This RFC seeks...
-
Currently php may handle OS signals using pcntl extensions:
-
With PHP 7, most fatal and recoverable errors in the engine where changed to instead throw an instance of Error. However this change was only made in the engine...
-
Modern UNIX kernels include additional, contextual information when delivering a signal, however the callable handler for pcntl_signal does not receive this inf...
-
Historically, PHP allows calling functions with fewer actual parameters than required by the function definition. These non-passed arguments lead to warning emi...
-
Historically PHP implementation accessed special $this variable using two different methods. In some cases this might lead to significant inconsistency, when $t...
-
Concern has been raised over the way failure is indicated by several functions in the core that are often used for security purposes. These functions may fail o...
-
PHP 7 has introduced exceptions as a replacement for fatal or recoverable fatal errors (see the Exceptions in the Engine RFC). These exceptions do not extend Ex...
-
The output buffering technique is used to speed up output, but also to capture intermediate output and use it elsewhere.
-
ICU exposes a great deal of i18n/l10n functionality beyond what is currently exposed by PHP. This RFC seeks to expose just a little bit more...
-
Currently, to access module globals in TS mode, a global resource array is used. That array contains globals from all the threads and per thread globals are ide...
-
-
Bug 67757 notes that the recently introduced PHP language specification differs from PHP's behavior when a switch statement defines multiple default cases. The...
-
PHP has had Closures since 5.3, and since 5.4 has had Closure::bind (static method) and Closure::bindTo (method) to allow creating new closures that have $this ...
-
This RFC proposes to accept the phpng refactoring codebase as the basis for the future major version of PHP, and move it into master.
-
PHP currently lacks a way to do integer division. While (int)(3 / 2), which does a floating-point division then casts to integer, does work most of the time, it...
-
Current PHP zval datatype implementation uses long datatype to handle signed integer and int datatype to handle string length. The most 64 bit capable platforms...
-
One of the most common fatal errors in PHP is the call to a member function of a non-object type. This occurs whenever a method is called on anything other than...
-
This RFC adds a new operator for combined comparison. Similar to strcmp() or version_compare() in behavior, but it can be used on all generic PHP values with th...
-
-
A memory usage improvement regarding receiving HTTP payloads with a potential reduction of 200-300%.
-
crypt() without salt parameter produces too weak password hash. However, many users are using crypt() without salt parameter.
-
-
PHP's DateTime class has unexpected outcomes when dealing with the
transitions between Daylight Saving Time and Standard Time.
-
Make parameterised MySQLi queries easier, with mysqli_execute_query($sql, $params).
-
The objective of this RFC is session module code cleanup, remove unneeded code complexity and redundancy.
-
With the continued discussion over the currently selected attribute syntax
@@ from the Shorter Attribute Syntax RFC
we want to revisit the syntax choice once an...
-
In 2018, various vulnerabilities were found in php web frameworks due to the phar stream wrappers. A call such as file_exists("phar://...somepath.extension/file...
-
This RFC proposes to allow an optional trailing comma in closure use lists. This is already supported for argument and parameter lists.
-
Since 2003, Throwable->getTraceAsString() and Throwable->__toString() have limited the length of string function arguments in stringified stack traces to 15 byt...
-
PHP currently treats namespaced names like Foo\Bar as a sequence of identifiers and namespace separator tokens. This RFC proposes to treat namespaced names as a...
-
We propose to use @@Attr or #[Attr] as the attribute syntax in PHP 8.0 instead of .
-
This RFC proposes the new nullsafe operator ?-> with full short circuiting.
-
-
PHP has for some time incorporated support for PKCS#7 sign, verify, encrypt, decrypt, and read operations.
Cryptographic Message Syntax (CMS) is a newer versi...
-
Sorting functions in PHP are currently unstable, which means that the order of equal elements is not guaranteed. This RFC proposes to make all sorts in PHP stab...
-
ext/xmlrpc relies on on libxmlrpc-epi, which is abandoned. Even worse, we are bundling a modified 0.51, while the latest version is 0.54.1. This is exacerbated ...
-
This RFC discusses a few amendments to the original Attributes RFC that was accepted for PHP 8.
-
Currently, it's possible to disable the json extension with ./configure --disable-json.
However, JSON is extremely useful to have because it's widely used for m...
-
Currently, a method with the same name as a parent's method, is still checked for some inheritance rules regardless of the parent's method visibility.
-
It is currently possible to write magic methods that have signatures that don't match the signature expected, such as __clone(): float or __isset(): Closure.
-
Currently, PHP requires to capture the exception being caught to a variable:
-
This RFC proposes to throw a TypeError when an arithmetic or bitwise operator is applied to an array, resource or (non-overloaded) object. The behavior of scala...
-
The current default error mode for PDO is silent. This means that when an SQL error occurs, no errors or warnings may be emitted and no exceptions thrown unless...
-
Currently, the definition of simple value objects requires a lot of boilerplate, because all properties need to be repeated at least four times. Consider the fo...
-
This RFC proposes to allow an optional trailing comma in parameter lists. This is already supported for argument lists.
-
str_starts_with checks if a string begins with another string and returns a boolean value (true/false) whether it does.
str_ends_with checks if a string ends w...
-
Since in PHP throw is a statement it makes it impossible to throw exceptions in places where only expressions are allowed, like arrow functions, the coalesce op...
-
The string representation of floats in PHP depends on the current locale as the decimal separator varies between locales. This can lead to subtle bugs in certai...
-
This RFC proposes Attributes as a form of structured, syntactic metadata to
declarations of classes, properties, functions, methods, parameters and
constants. A...
-
str_contains checks if a string is contained in another string and returns a boolean value (true/false) whether or not the string was found.
-
-
The token_get_all() function currently returns tokens either as a single-character string, or an array with a token ID, token text and line number. This RFC pro...
-
Traits can contain abstract methods, which are used to specify requirements the trait has on the using class. However, the signatures of these methods are curre...
-
This RFC introduces a new Stringable interface that is automatically added to classes that implement the __toString() method.
-
The Foo\Bar::class syntax has been introduced in PHP 5.5 to allow fetching a class name as a string, in a way that respects context-dependent name resolution ru...
-
The static special class name in PHP refers to the class a method was actually called on, even if the method is inherited. This is known as late static binding ...
-
The Uniform Variable Syntax RFC resolved a number of inconsistencies in PHP's variable syntax. This RFC intends to address a small handful of cases that were ov...
-
Weak maps allow creating a map from objects to arbitrary values (similar to SplObjectStorage) without preventing the objects that are used as keys from being ga...
-
Working with XML (HTML) documents is a necessary task for many web applications
and the dom extension implements a standardized API that was previously
specifie...
-
A union type accepts values of multiple different types, rather than a single one. PHP already supports two special union types:
-
While newly introduced error conditions in the engine typically use Error exceptions, we have many old error conditions that use inappropriate severity levels f...
-
Inheritance errors due to incompatible method signatures (LSP violations) currently either throw a
fatal error or a warning depending on the cause of the error ...
-
Comparisons between strings and numbers using == and other non-strict comparison operators currently work by casting the string to a number, and subsequently pe...
-
For user-defined functions, passing a parameter of illegal type results in a TypeError. For internal functions, the behavior depends on multiple factors, but th...
-
It's no secret that the performance jump of PHP 7 was originally initiated by attempts to implement JIT for PHP. We started these efforts at Zend (mostly by Dmi...
-
On the documentation for array_fill the start_index description mentions: If start_index is negative, the first index of the returned array will be start_index ...
-
PHP 8.5 introduced the pipe operator (|>), enabling functional-style transformation chains. A common pattern is piping a variable through transformations and as...
-
PHP's __isset() magic method has a structural ambiguity: it returns one bit but is asked two
questions (does it exist? and is it non-null?). The language constr...
-
This RFC adds generic type syntax to PHP. Classes, interfaces, traits,
functions, methods, closures, and arrow functions can declare type
parameters; those para...
-
In PHP applications, it is very common to work with deeply nested arrays, especially when dealing with configuration data, decoded JSON payloads, request data, ...
-
-
Working with arrays often requires selecting or excluding a subset of keys. Many frameworks provide helper functions like array_only_keys() and array_except_key...
-
Readonly properties and Constructor Property Promotion (CPP) don't mix well: any post-processing forces opting out of CPP.
-
In PHP applications, its extremely common to normalize strings by conditionally adding, removing, or replacing a prefix or suffix. Today, developers typically i...
-
This RFC proposes the introduction of the let() construct, a new language construct for managing lifetimes of variables. It allows developers to define a block ...
-
PHP has the concept of alias functions, where a function can have more than one name. Here are some examples of aliases:
-
PHP 8.0 introduced the str_contains function, which provides a clear and concise way to determine if a string contains a given substring. This was a significant...
-
PHP has a few type juggling contexts, which are described on the
Type Juggling
documentation page.
Currently, there are 6:
-
This RFC proposes an alternative syntax for single-expression functions using the => operator instead of curly braces and explicit return statements.
-
For a use case, and the inspiration for this RFC, consider the case of the BackedEnum interface that was added in PHP 8.1. It is defined as:
-
Nested classes allow the definition of one class within another, enabling tighter encapsulation and better organization of related logic. This feature naturally...
-
PHP's implements keyword allows classes to declare that they implement one or more interfaces. This mechanism is strict: the specified interfaces must exist at ...
-
Multibyte levenshtein distances have feature requests in the past. Therefore, we would like to create the mb_levenshtein function to implement this.
-
Support for hooks on readonly properties was omitted from the original RFC, primarily to minimize complexity as there were questions around when it was safe to ...
-
A static class is a class that cannot be instantiated, and whose members (properties and methods) are all static. Implicit static classes can be created today, ...
-
This RFC proposes to make anonymous classes final by default.
-
This RFC proposes to add support for final anonymous classes.
-
round() can specify the operating mode when edge case values such as HALF_UP and HALF_DOWN are passed. For example, 0.285 is internally 0.28499999999999998. Sh...
-
PHP contains several build-in rounding functions round, ceil, floor and number_format.
-
The tempnam function allows users to optionally specify a prefix to be prepended to the generated filenames.
-
The Open Source project that develops the PHP language and its reference implementation uses an RFC process to discuss
and vote on proposed changes. This was cr...
-
The PHP code base has grown over more than 2 decades, which leaves some room for code cleanups. While attempting to fix several crash bugs in the JIT, I found t...
-
This RFC proposes adding an operator for default values in destructuring assignments.
-
PHP has long had the ability to control the visibility of object properties -- public, private, or protected. However, that control is always the same for both...
-
Over time, authors sometimes want to add methods to an interface. Today, this causes large breakages to every implementor. This RFC proposes a way to reduce the...
-
Since version 7.62.0 of libcurl, 1 the library features a brand new URL API 2 that can be used to parse and generate URLs, using libcurls own parser. One of the...
-
Anonymous functions in PHP can be verbose, in part due to the need to manually import used variables. This makes code using simple closures hard to read and und...
-
Currently there are different login systems all over php.net:
-
When not using strict_types in PHP, scalar type coercions have become less lossy/surprising in the last years - non-number-strings cannot be passed to an int ty...
-
This RFC is to implement a new function to PHP that upgrades the functionality of array_column to group similar results that share the same index_key into a mul...
-
This is due to the historical background, starting with lcg.c / php_lcg.h, the first implementation of the linear congruential generator (LCG), followed by rand...
-
Operator overloading in PHP is currently supported within the engine for C code, and has well engineered designs built into the structures for objects and class...
-
Intersection types as currently accepted for PHP 8.1 are not nullable. This RFC proposes to make them so.
-
Programs can serialize data to JSON using the json_encode function. The function is widely used for generating JSON responses or payload over HTTP. Currently, i...
-
Although enums are immutable objects, it is often useful to have functions or methods that operate on enum instances. In many cases, it would make sense to decl...
-
The purpose of inheritance is code reuse, for when you have a class that shares common functionality, and you want others to be
able to extend it and make use o...
-
Currently, PHP does not provide a built-in way to store the state of an arbitrary iterable for reuse later (when the iterable has arbitrary keys, or when keys m...
-
var_export() is a function that gets structured information about the given variable. It is similar to var_dump() with one exception: the returned representatio...
-
PHP currently implements an RNG based on the Mersenne Twister, which can be used with mt_srand() and mt_rand().
-
Many REPLs (Read-Eval-Print Loops) for other programming languages that I'm familiar with print a (possibly truncated) representation of the result of expressio...
-
The current OPCache cannot get rid of the source file to execute the opcode file. The path will allow OPCache direct execution opcode file without php source co...
-
Short lambdas / arrow functions offer a convenient, compact way to write simple closures as a single expression. This RFC offers the same convenience for named...
-
The primitives any() and all() are a common part of many programming languages and help in avoiding verbosity or unnecessary abstractions.
-
The debug_backtrace() function currently returns stack trace frames as an array of arrays with information about the file, line, class, type, object, args and f...
-
At the moment, constructors and destructors can return values. However, these magic methods are supposed to be void (according to the documentation) and should ...
-
Currently, it isn't possible to enable optimizations without enabling caching.
They should be orthogonal features - it's already possible to cache without
optim...
-
This proposal defines a syntax for partial function application in PHP. It has been designed to provide a maximum of functionality with a minimum of new syntax...
-
Code like the following is quite common in procedural code:
-
-
-
The T_PAAMAYIM_NEKUDOTAYIM token representing the :: characters sequence is often a source of confusion the first time it is encountered.
-
The PHP project has reserved the right to use the \PHP namespace but has never acted upon starting to use it. We therefore propose that core symbols which canno...
-
Adds the possibility to cast values while using array or list destructuring expressions.
-
-
This RFC proposes an object-oriented approach around request and response functionality already existing in PHP, in order to reduce the global mutable state pro...
-
This RFC proposes to add support for a new property modifier that would allow properties to be initialized, but not modified afterwards. This feature would be u...
-
At the moment expressions like $a + $b or $a * 2 are only valid if $a and $b are scalar types like int or float. However, in many other programming languages li...
-
When calling a function or using a constant that isn't fully qualified from a namespace (other than the global namespace),
PHP will check these two locations in...
-
PHP contains multiple functions for executing system commands from within a PHP script as detailed in the Program execution functions section of the manual (htt...
-
PHP doesn't have a convenient literal syntax for creating an object and initializing properties. This makes creating objects and initializing their state quite ...
-
In addition to
-
By far the most common usage of stdClass is (as the manual defines) Created by typecasting to object, or from the result of a call to 'json_decode()' using the ...
-
This RFC builds on the motivation of previous discussions with a new proposal for the ability to override the default behaviour of object comparison that was in...
-
PHP 7.1 added an iterable pseudo-type which is a union of array and Traversable.
Although iterable is very useful, sometimes it's necessary to convert it to an ...
-
Class Friendship allows a class to be better encapsulated by granting per-class access to protected members. Class Friendship is an explicit and concise express...
-
The SQLite driver of PDO is missing some features provided by the SQLite3 extension, namely openBlob which allows to access a stored blob as a stream/file point...
-
PHP 7.0 introduced the Null Coalescing Operator (??), which provides a convenient, more concise alternative to isset() or an explicit NULL check when retrieving...
-
Proposal to adopt the Doxygen documentation style for the C sources of PHP
-
Universally Unique Identifiers (UUIDs, also known as Globally Unique Identifiers [GUIDs]) are 128 bit integers that guarantee uniqueness across space and time. ...
-
Currently Exception::$code, Error::$code and Throwable::getCode() are said to be int only, but this is actually violated by PHP itself, specifically by the PDO ...
-
In version 5.2.1, the b prefix and the (binary) cast were introduced for forward compatibility with the PHP-6 project. However, that project never came to be an...
-
Currently, only C module can add additional session data serializer. With user defined session data serializer, users can
-
Input data validation is the most important security measure in software security.
-
PHP does not contain functions to test if a string begins or ends with a certain substring. This is currently possible using several other functions, but adding...
-
This RFC proposes the addition of new operator for context-dependent escaping. This operator is intended mainly for HTML escaping but it allows to add handlers ...
-
Due to HTTP cookie implementation, it is easy to create unchangeable/undeletable cookies via JavaScript injections. Single JavaScript injection vulnerability or...
-
Debug, error, and exception messages in PHP often contain type information about variables that did not satisfy a defined validation constraint. The idiomatic w...
-
The idiomatic way to retrieve type information of a variable in PHP is via the gettype() function. This function suffers from upholding backwards compatibility ...
-
For PHP 7.0 the ReflectionType API was introduced in conjunction with return types. Its minimal API was intended to be the base for future improvements; this R...
-
Attributes (or annotations) are a form of syntactic metadata that can be added to language classes, functions, etc. PHP offers only a single form of such metada...
-
A functional interface is an interface which declares only one abstract method, a familiar example is Countable:
-
Typed Properties allow for an optional keyword in the definition, after the visibility scope, which contains the type the property should allow.
-
This RFC proposes that var be deprecated in PHP 7.1 (in favor of public) and its functionality removed in PHP 8.0.
-
Due to the desire to maintain compatibility with PHP, alternative runtimes such as HHVM set the PHP_VERSION constant to something like 5.6.0-hhvm (utilizing the...
-
Long numerical literals can be a source of poor readability in code. Take the following examples:
-
This RFC proposes an evolution of the callable type, scoped to argument lists. This should allow more detailed declarations
of callable type declarations - incl...
-
JSON is a data format that is often used for data exchange between different platforms. These platforms can have different number representation which might lea...
-
This RFC adds a new in operator which simplifies contains checks for strings and arrays. The in operator makes these checks way more readable and lowers the cog...
-
In userland it is sometimes necessary to extend PHP's notices/warnings with
additional information (e.g. username from session, request-uri, http-host, stack tr...
-
-
This RFC aims make empty() have a variable arity.
-
PHP has type declarations which can be associated with function parameters or return values. These declarations perform two useful roles:
-
In PHP, it is very common for function is to have many optional arguments, like this:
-
There is going to be a new major release of PHP, PHP 7, and we have agreed on a timeline for it. Because it is a major release that breaks backwards-compatibili...
-
Please understand only one of the following proposals can be accepted, not both.
They're explained together because the address the same issue.
-
This RFC proposes to introduce the concept of default constructors into PHP. The meaning of it is that whatever is the parent class, child class can always call...
-
In PHP array keys can be only represented as numbers and strings. However, there already are several classes that represent different kinds of numbers (such as ...
-
Currently, PHP only provides one means of type conversion: explicit casts. These casts never fail or emit errors, making them dangerous to use, as when passed g...
-
PHP 5.3 brought namespaces and aliasing/importing by use operator. Aliases are expanded to FQN (Fully Qualified Name) in the compile-time phase and user-land co...
-
It is often desirable to perform a set of actions if the conditions to enter a loop are not met. This can require a significant amount of boilerplate code if th...
-
-
At present, arrays are a tad cumbersome to define. String keys must be quoted and followed by a double arrow, then the element ends with a comma:
-
The current array dereferencing syntax for string keys is somewhat cumbersome:
-
HTML escape can be improved by escaping all dangerous chars. HTML escape can be improved by escaping , , ', & and /.
-
This RFC discusses the alternative implementation of mbstring extension that in turn uses ICU instead of libmbfl.
-
For example, addslashes()/stripslashes() has vulnerability that allows PHP script execution and DoS under certain environment via char encoding based attack. Co...
-
This RFC proposes a syntax to add to improve type-hinting, allowing an array of that hinted type to be passed as an argument, thus improving readability of code...
-
This will add support for decrementing alphanumeric strings (ab, for example) to complement the existing incrementing behaviour.
-
Current PHP zval datatype implementation uses long datatype to handle signed integer and int datatype to handle string length. The most 64 bit capable platforms...
-
This RFC proposes to allow the use of exceptions in the engine and to allow the replacement of existing fatal or recoverable fatal errors with exceptions.
-
When writing constructors, most constructor bodies usually just assign passed arguments to some properties. While technically not a problem, it is somewhat tedi...
-
This RFC aims to remove some restrictions which are due to the fact that keywords are not included in T_STRING (especially for class const, method and class nam...
-
Coming to Object-Orientated Programming, PHP offers a variety of possibilities to obtain information about classes and their instances (objects). In this regard...
-
PHP has long supported trailing commas in array declarations like so:
-
This RFC proposes a different typehinting syntax for the property accessors proposal. The proposed syntax places the typehint before the property name rather th...
-
This RFC proposes a new array function that can extract multidimensional slices for arrays.
-
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...
-
PHP 5 introduced the concept of autoloading classes.
-
This isn't done yet, don't read it yet. please?
-
Frequently PHP developers need to initialize some variable that is passed in via the outside to some value. This leads to repeated code, that is needlessly pron...
-
-
Add the function is_literal(), a lightweight and effective way to identify if a string was written by a developer, removing the risk of a variable containing an...
-
include()/require() is source of file/script inclusion for a long time. Script inclusion is extremely severe security breach and PHP is too weak against script ...
-
This proposal fixes session management design issue. Session ID management requires more precise management. Otherwise,
-
-
Even cryptographic hashes have secret information disclosure/analysis risks with string concatenations. For example, following code is weak (could be more vuln...
-
PHP has always treated function, method, and class names as case-insensitive. That was a pragmatic early design decision, but it now creates inconsistency witho...
-
This RFC proposes the deprecation of the metaphone function in PHP 8.6
-
The trim(), ltrim(), and rtrim() functions strip whitespace (or other characters) from the beginning and end of a string. When the second parameter ($characters...
-
-
The RFC proposes to deprecate PEAR, and to recommend Composer for installing PHP packages going forward.
-
This RFC proposes the addition of two new functions to PHP's standard library: is_representable_as_float() and
is_representable_as_int().
-
This RFC aims to clarify and codify the rules regarding backward compatibility and userland API compatibility in PHP minor versions. Currently, there is no form...
-
The PHP array sort functions take the array to sort as a by-reference array to sort the array in place.
However, since PHP 5.6 these function have only ever ret...
-
The only way to pass the default value to a function or method parameter is to not pass anything. This can be particularly difficult in some circumstances, beca...
-
The PHP project has had a long-standing but unwritten, vague, and inconsistently applied proscription against mentioning or using third-party PHP projects on th...
-
According to https://github.com/php/php-src/blob/master/CONTRIBUTING.md, pull requests are only allowed for three things:
-
The engine currently doesn't allow enums to implement Stringable. This RFC proposes that string-backed enums auto-implement Stringable, while still disallowing ...
-
-
null corresponds to PHP's unit type, i.e. the type which holds a single value.
-
Parameters in PHP are contravariant to preserve Liskov substitution. This means that if class B extends class A, then redefines a function call, the entire type...
-
After a foreach by reference loop, the value variable currently remains a reference to the last array element, which may result in unexpected behavior if the va...
-
clamp checks if a int|float value is within a certain bound. If the value is in range it returns the value, if the value is not in range it returns the nearest ...
-
PHP offers a function for parsing query string into an array. The function, for historical reasons, has been designed to allow registering the values as global ...
-
Ticks allow running a function for every N low-level tickable statements. Historically, they have been used for handling pcntl signals. However, they have outli...
-
Inspecting the current stack trace depth is occasionally useful for manually debugging, checking for potential infinite recursion, or for checking if code would...
-
Printing a string followed by a newline to stdout is a commonly performed operation in many applications. Many programming languages provide a helper function t...
-
On most platforms, PHP currently measures the request timeout based on CPU time, rather than wall-clock time, so neither sleep(), nor network or system calls co...
-
The rules PHP uses for type juggling with operators are complex, varying by operator as well as the types and values of the operands.
-
In 25yrs history, many language constructs were allowed in different forms depending on the context.
-
-
-
As currently implemented, the instanceof operator is inconsistent.
-
The switch statement has some long-standing issues that we're going to look at in this RFC.
-
Intuitively, the ++ and -- operators are equivalent to add 1 to variable and subtract 1 from variable, respectively. As such, it would be expected that $a=$a+1,...
-
Currently, constant expressions in declarations allow a limited set of expression types such as literals, constants, and operations.
This RFC proposes allowing ...
-
The current design of PHP's switch statement follows closely languages such as C/C++ and supports fall-through semantics by default.
The traditional switch stat...
-
Implement strrstr (and possibly strristr) for consistency with the strpos string functions family.
-
In PHP most types are consistent; a float is a float whether it is in a function, in a static method, or is a global variable. Ints, bools, resource, strings et...
-
Object properties in PHP are primarily defined in class definitions; however, they can also be added to or removed from individual instances at any time. This R...
-
-
For many years, we receive bug reports regarding the strange behavior of the $escape parameter of our CSV writing and reading functions (fputcsv, fgetcsv etc.);...
-
In PHP, if continue is applied to a switch statement, it behaves the same as break. In other languages, it would continue the surrounding loop instead. To avoid...
-
WDDX has been designed as programming language independent data exchange format for the web1). However, PHP 4.0.0 added the ability to (de)serialize class insta...
-
Whenever json_encode() or json_decode() are called, you must call json_last_error() to check if a failure occurred.
-
Introduce namespaces to user-level symbols to avoid collisions with user defined symbols, decrease breaking changes due to the introduction of new symbols and t...
-
The PDO extension does not have a type to represent floating point values.
-
-
Anonymous functions and closures can be verbose even though sometimes they are quite simple and contain only a single expression. Additionally, importing variab...
-
This RFC proposes a new core function to simplify the process of changing an array's keys (re-keying).
-
PHP's implementation of ICU is still incomplete. One of the features currently missing is a wrapping of UCharsetDetector meant to make an educated guess as to ...
-
Arrays in PHP have long since supported trailing commas.
-
PHP presently offers the ability to import class-like structures (classes, interfaces and traits) via a callback (or series of them) that can be registered. Thi...
-
JSON in php currently supports the Serialization of objects using the \JsonSerializable interface. However it does not support the unserialization of JSON strin...
-
Anonymous functions, also known as closures, allow the creation of functions which have no specified name. They are most useful as the value of callback paramet...
-
This RFC proposes to conditionally add a strict argument count check for function calls on PHP7, being sensitive towards implementations already depending on th...
-
Adds a new method to ReflectionParameter to allow easy access to a class name in a type hint, avoiding the need to actually load the class and use `getClass()->...
-
-
There is currently no way to make a property readable to everyone and writeable only to the containing object, with PHP's visibility specifiers allowing all or ...
-
A discussion whether it is feasible to add sync PECL extension to the core.
-
For the longest time, PHP has lacked first-class functions. Because of the separate namespaces, functions and methods can't be dealt with directly like other ar...
-
Since the beginning, PHP has had only two numeric types: integer, and float. The former has been a platform-dependent C long, usually either 32-bit or 64-bit, a...
-
Note: Previously, here was a description of the issues related to the 'read_only' option, which was later renamed to 'read_and_close', effectively solving the p...
-
proposal 0: options by session_start()
-
Sadly, Anthony Ferrara decided to stop developing PHP and withdrew all of his RFCs. Since I liked this one, I am re-opening it here. The original RFC was at htt...
-
Following on from anonymous classes, this RFC proposes we support nested classes in PHP.
-
This RFC brings static scalar expressions to the parser. This allows places that only take static values (const declarations, property declarations, function ar...
-
Currently PHP uses an enforced interface style, where the argument object to a function or method must implement the respective interface. This RFC discusses in...
-
When localhost is set as the mysql host, the connection is set to connect to the specified socket. If no socket is set the hardcoded default of /tmp/mysql.sock ...
-
This RFC recommends a set of changes to the tempnam() standard function.
-
Currently, PHP has no way to provide type hinting for function parameters which are not classes or arrays. This is on often requested feature that has been disc...
-
Allow use AS in the closure declaration, like:
-
Currently, PHP has no way to provide type hinting for function parameters which are not classes or arrays. This is on often requested feature that has been dis...
-
The purpose behind this RFC is to introduce return type hinting to PHP class methods. This RFC differs from the existing entry with a completely different conc...
-
The original voting RFC has left open some questions about who can vote, and how are the community representatives selected/elected.
These shortcomings were bro...
-
strncmp doesn't supporting negative length:
-
Magic Quotes needs to be done away with. This needs to be done in a safe, orderly manner.
-
PHP 8.1 introduced Deprecate passing null to non-nullable arguments of internal functions. While the consistency is welcome (user-defined vs internal functions)...
-
Both php_rand() and php_mt_rand() internal function provides pseudo random numbers. php_rand() uses system random function which has less randomness compare to ...
-
There session_module_name(), mb_regex_encoding(), etc that get/set INI values. These functions are duplicate of ini_get()/ini_set(). In addition, INI name and f...
-
Currently, the Zend Engine exposes several methods to PECL extensions and internal classes to control how internal objects behave when casting to primitives, an...
-
Currently, array to string zval conversion raises an E_NOTICE and returns a string
containing 'Array'.
-
This RFC proposes OPcache Static Cache: an OPcache-managed shared-memory cache for explicit userland values and selected PHP static state.
-
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...
-
Many PHP internal functions currently return false when invalid argument values are passed. Modern PHP prefers throwing ValueError for invalid inputs.
-
Adds PDO::disconnect() to disconnect from an established database connection and PDO::isConnected() to query connection status.
-
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.
-
We consider the grouping of elements within an array a very basic and common functionality.
-
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...
-
During the last releases of the language the support for types is increasing. We can already add types in a lot of contexts:
-
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...
-
The current implementation of named parameters breaks object polymorphism.
-
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.
-
Adds the possibility to extend values with type declarations while using array or list destructuring expressions.
-
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...
-
The internals email mailing list is the main tool that is used to coordinate work on the PHP project.
-
This RFC proposes to add a new magic method called __toArray() to allow a class to control how it is represented when converted to an array.
-
If two arrays are equal/identical, they should remain equal/identical arrays after
the same array_push(..., $val) call is executed on both of them:
-
PHP users often say that they find defining the lexical-scope imports cumbersome, because
they hate importing the variables explicitly.
-
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...
-
Changing default setting session.use_strict_mode to use strict mode sessions by default preventing session fixation by session adoption.
-
The backtick operator (`dir D:\foo`) is used to execute commands via shell.
-
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...
-
-
This RFC proposes a way to opcode-cache the PHP code generated via a stream wrapper.
-
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...
-
PDO defines a NULL type, but this concept is not part of the SQL standard. Types are nullable, but there is no type that can only have that value.
-
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...
-
Fallback to global scope allows namespaces to access in an unqualified manner symbols actually residing in the root namespace.
-
Current predictable PRNG, i.e. mt_rand() and rand(), produces very weak random values even produces non random values.
-
According to RFC 2396 defining URI Generic Syntax which specifies URI Syntactic Components:
-
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...
-
As the community moves on from PEAR and migrates to composer, the inclusion of PEAR in the PHP package is starting to make less and less sense.
-
The retry keyword will make it easier to re-execute code blocks that failed due to recoverable errors by jumping to the top of the try block.
-
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...
-
Anonymous classes are cumbersome to use because they lack support for lexical scope [use()].
-
This RFC proposes adding support for Source Map Revision 3.
-
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...
-
Allow traits to implement interfaces. Classes that insert the trait would then implement the interface, as though it was declared on the class.
-
This RFC proposes that the PHP project should adopt a formal code of conduct for its members.
-
This RFC proposes the addition of generic types and functions to PHP.
-
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...
-
So far, every PHP type is supported by both parameter typehints and return types, except resources. This RFC should close this gap.
-
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...
-
Design by Contract(DbC) or Contract Programming is new way of program development that many languages support.
-
When allow_url_include was introduced, it was good enough protection against remote script inclusion. However, it causes problem for local script inclusion prot...
-
This RFC proposes changes in the ruleset used to filter
and convert input arguments to internal functions.
-
This RFC proposes an introduction of userland parser extensions API for providing an access to the low-level Abstract Syntax Tree (AST) parser.
-
The D manual contains the following succinct definition of contracts:
-
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...
-
There are number of INI set/get functions. This RFC proposes deprecation of these functions.
-
This RFC is about making the PHP core case-sensitive.
-
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...
-
This RFC suggests adding support for links in stream wrappers by adding appropriate hooks.
-
-
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...
-
This RFC proposes that the behaviour of bitwise shift operations on strings be altered to match the behaviour of bitwise shifts on integers.
-
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 ...
-
Security matters almost all applications. PHP needs ability to handle cryptography by default.
-
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 ...
-
PHP has been developed about 20 years. Many legacy functions/methods do not comply CODING_STANDARDS Naming Conventions.
-
There are number of in comparison and conversion inconsistencies.
-
@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...
-
GMP arithmetic with normal operator is added by
https://wiki.php.net/rfc/operator_overloading_gmp
-
The current behaviour of increment and decrement operators is not very intuitive:
-
Two new operators. ?= for setting the value of an unset or falsey variable. And ??: which acts like ?: except it it also checks is set.
-
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...
-
This RFC proposes a new API for internal object serialization and unserialization.
-
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...
-
Note: This RFC has been superseded by another Abstract Syntax Tree RFC.
-
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 ...
-
Note: This RFC has been superseded by another Named Parameters RFC.
-
-
-
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...
-
This RFC seeks to add options to the CLI SAPI that would enable all and no error display.
-
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...
-
The purpose of this feature is to create the most random number/string possible, and have it work on every system. The API is still undetermined.
-
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 ...
-
Exceptions are a proper way of handling errors and are used in many other languages exclusivley.
-
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...
-
This RFC proposes to eliminate an inconsistency in the way protected class members are resolved.
-
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...
-
Add LiteralString type, and is_literal_string(), to distinguish strings from a trusted developer, from strings that may be attacker controlled.
-
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 ...
-
This RFC improves the str_replace() and str_ireplace() functions.
-
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...
-
PHP marshals external key-value pairs into super-globals by mangling some disallowed characters to underscores:
-
password_hash() is introduced from PHP 5.5 as crypt() wrapper and has Blowfish(PASSWORD_BCRYPT) hash algorithm as the only hash function available.
-
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...
-
-
This RFC is to discuss the addition of 2 new operators to the core, a logical left shift and a logical right shift.
-
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...
-
-
-
The purpose of this RFC is to provide a way to support source files that do not begin with
-
-
-
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.