Skip to content
PHP News
Search

The future of PHP

RFC Tracker

Follow the proposals shaping the next version of PHP.

35
Under discussion
00
In voting
30
Accepted this year
09
Declined this year

Readonly Variables

Discussion

Adds a readonly modifier for local variables, so reassigning one after its first assignment throws an error.

Last activity

Adds an immutable Uri\QueryParams class to parse, change and build query strings outside of $_GET, including RFC 3986 query strings.

PHP 8.6

Last activity

Lets a parenthesized boolean expression end with a trailing &&, ||, and or or, the same way trailing commas already work.

PHP 8.6

Last activity

Pipe to return

Discussion

Lets a pipe chain end in return, so "Hello World" |> strlen(...) |> return; returns the result reading left to right.

Last activity

Adds a native values() method to backed enums that returns every backing value in declaration order, unless the enum defines its own.

PHP 8.6

Last activity

Adds (?type) casts that let null pass through and (!type) casts that reject null, both throwing on malformed input like "123abc".

PHP 8.6

Last activity

Context Managers

Discussion

Adds a using keyword and a ContextManager interface, borrowed from Python, that guarantee setup and cleanup around a block of code.

PHP 8.6

Last activity

Adds a #[NoSerialize] attribute that leaves a property out of serialize(), or forbids serializing a whole class.

PHP 8.6

Last activity