[PHP-DEV] [RFC] Deprecations for PHP 8.6

Hello internals,

It is this time of year again where we proposed a list of deprecations to add in PHP 8.6:

As a reminder, this list has been compiled over the course of the past year by different people.

And as usual, each deprecation will be voted in isolation.

We still have a bit of time anyone else to propose additional deprecations, and if you have write access feel free to add them directly to the RFC.
Please note that with the new RFC policy rules the RFC must be finalized and in a "frozen" state by the 13th of July at the latest.

Some deprecations should be non-controversial, others a bit more.
If a deprecation is really controversial, it might warrant its own dedicated RFC or be dropped altogether.

Best regards,

Gina P. Banyard

Hi Gina,

Le lun. 22 juin 2026, 15:19, Gina P. Banyard internals@gpb.moe a écrit :

Hello internals,

It is this time of year again where we proposed a list of deprecations to add in PHP 8.6:

https://wiki.php.net/rfc/deprecations_php_8_6

As a reminder, this list has been compiled over the course of the past year by different people.

And as usual, each deprecation will be voted in isolation.

We still have a bit of time anyone else to propose additional deprecations, and if you have write access feel free to add them directly to the RFC.
Please note that with the new RFC policy rules the RFC must be finalized and in a “frozen” state by the 13th of July at the latest.

Some deprecations should be non-controversial, others a bit more.
If a deprecation is really controversial, it might warrant its own dedicated RFC or be dropped altogether.

Best regards,

Gina P. Banyard

After a quick check, I’m wondering about

Deprecate CURLOPT_PROGRESSFUNCTION for curl_setopt()

Can you expand on this?

Thanks,
Nicolas

Hi Gina, thanks for working on this. Unfortunately none of the proposals contain a proper impact analysis. I don’t hold this against you personally, I know this RFC is the work of quite a few people, but I do find it terribly irresponsible that the impact of these deprecations is not outlined for the voters to help their decision making. In my experience, it would be quite trivial to create an impact analysis for the fast majority (~70%) of the current proposals using PHP_CodeSniffer and PHPCompatibility. I’d be happy to help get that set up if there is interest in adding such an analysis to the proposals. Smile, Juliette

···

On 22-6-2026 15:13, Gina P. Banyard wrote:

It is this time of year again where we proposed a list of deprecations to add in PHP 8.6:

[https://wiki.php.net/rfc/deprecations_php_8_6](https://wiki.php.net/rfc/deprecations_php_8_6)

On 22 June 2026 14:13:19 BST, "Gina P. Banyard" <internals@gpb.moe> wrote:

Hello internals,

It is this time of year again where we proposed a list of deprecations to add in PHP 8.6:

PHP: rfc:deprecations_php_8_6

The one that stands out to me at first glance is the _() alias for gettext()

I understand the motivation, but removing it is likely to be extremely disruptive, particularly paired with banning it as an identifier so users can't polyfill it.

_() is basically the canonical way to use gettext in every language it's been ported to. The idea is that you can write code and templates with hard-coded English/base-language strings, and wrap them with a small amount of punctuation rather than extra words.

While replacement would be relatively straightforward, affected codebases are likely to have thousands of uses, and the end result would be a reduction in readability.

If we want to go down this route, we need a stronger justification than is given - does it actually cause a *problem* reserving it only in class-like context, or is the proposal just for neatness?

Rowan Tommins
[IMSoP]

On 22 June 2026 17:11:17 BST, "Rowan Tommins [IMSoP]" <imsop.php@rwec.co.uk> wrote:

The one that stands out to me at first glance is the _() alias for gettext()

Sorry for the double reply, but I just checked the comments on the PR linked from the RFC Deprecate using "_" as a class name by Girgias · Pull Request #15360 · php/php-src · GitHub

There's a comment from Ilija saying that even the existing deprecation probably isn't needed, further weakening the case.

There's another comment saying that class_alias already shows the deprecation, which 3v4l confirms: Online PHP editor | output for QEcZs

Rowan Tommins
[IMSoP]

Hey Gina,

Am 22.06.2026 um 15:13 schrieb Gina P. Banyard internals@gpb.moe:

Hello internals,

It is this time of year again where we proposed a list of deprecations to add in PHP 8.6:

PHP: rfc:deprecations_php_8_6

As a reminder, this list has been compiled over the course of the past year by different people.

And as usual, each deprecation will be voted in isolation.

We still have a bit of time anyone else to propose additional deprecations, and if you have write access feel free to add them directly to the RFC.
Please note that with the new RFC policy rules the RFC must be finalized and in a “frozen” state by the 13th of July at the latest.

Some deprecations should be non-controversial, others a bit more.
If a deprecation is really controversial, it might warrant its own dedicated RFC or be dropped altogether.

Best regards,

Gina P. Banyard

Thanks for compiling this list, I think it’s more reasonable and a bit smaller than previous editions. Thanks for that.

Could you please expand on the potential gains on “Deprecate ArrayIterator methods that inherit ArrayObject implementation”? A vague promise of unlocking potential optimizations is not very persuading.

The “_” deprecation feels more like a change for the sake of it (consistency with a removal which has actual incoming functionality), even though there’s no actual benefit for it for constants. There’s no reason I can imagine why we’d ever need underscores in function call position for another language feature.

I don’t think we should deprecate “let”. let is universally used for block-scoping in other languages. I don’t think PHP should ever have block-scoping inside functions. The corresponding RFC was also declined with 50%+ of the vote. Hence I don’t think we should deprecate a name which won’t ever be needed.

On “Deprecate changing by-reference return modifier via inheritance” - how exactly is this a LSP violation? If you assign a value without explicit “&” it’ll be by-value, regardless of it being reference or not. If you put “&” there, you intentionally want a reference and you will get a warning when trying to use it. There’s no magic “this value was a reference, hence this behaves differently now” in PHP, but references trivially decay to values, when used in a by-value context.
This is basically covariance. There’s no need to change this, and I assume there was a logic error from the author of that suggestion.

One question, is “Passing objects which are interpreted as arrays” one big vote, or does each item get a vote? For array_walk(_recursive) specifically, I see some value of using it - sometimes data structures are available in object form, saving a cast … and a cast back, which is not trivial, unless it’s a stdclass. Everything else, I do agree with.

Also, why would we deprecate CURLOPT_PROGRESSFUNCTION? According to https://grep.app/search?f.lang=PHP&q=CURLOPT_PROGRESSFUNCTION it’s quite widely used in widely used libraries, like guzzle and symfony. And I wouldn’t know what it’s replacement would be?

Bob

On 22 June 2026 17:38:29 BST, Bob Weinand <bobwei9@hotmail.com> wrote:

I don't think we should deprecate "let". let is universally used for block-scoping in other languages. I don't think PHP should ever have block-scoping inside functions. The corresponding RFC was also declined with 50%+ of the vote. Hence I don't think we should deprecate a name which won't ever be needed.

The RFC raised was for a unique-to-PHP concept of a special "scope block" using the "let" keyword in a way no other language does. Taking that vote to mean nobody wants block scoping is a huge stretch.

In fact, I think block scoping would be a really useful addition to the language, and hope someone brings forward a proposal which more closely mirrors other Algol-descended languages. For me, it is a prerequisite for auto-capture closures, because it gives a way to unambiguously opt *out* of capture; but it also has plenty of other uses, just as it does in other languages.

Whether we need to reserve the name to allow that, I will leave to those who know more about the parser.

Rowan Tommins
[IMSoP]

On Mon, June 22, 2026 at 10:38 Bob Weinand wrote:

Also, why would we deprecate CURLOPT_PROGRESSFUNCTION? According to https://grep.app/search?f.lang=PHP&q=CURLOPT_PROGRESSFUNCTION it’s quite widely used in widely used libraries, like guzzle and symfony. And I wouldn’t know what it’s replacement would be?

Per the PHP documentation for CURLOPT_PROGRESSFUNCTION 1:

deprecated as of cURL 7.32.0. Use CURLOPT_XFERINFOFUNCTION instead.

The cURL page for this option also states that it is deprecated since 7.32.0. 2

It probably would be good to update the RFC to clarify this.

Sincerely,
Theodore

On Mon, Jun 22, 2026 at 6:59 PM Juliette Reinders Folmer <php-internals_nospam@adviesenzo.nl> wrote:

On 22-6-2026 15:13, Gina P. Banyard wrote:

It is this time of year again where we proposed a list of deprecations to add in PHP 8.6:

[https://wiki.php.net/rfc/deprecations_php_8_6](https://wiki.php.net/rfc/deprecations_php_8_6)

Hi Gina, thanks for working on this.

Unfortunately none of the proposals contain a proper impact analysis.

I don’t hold this against you personally, I know this RFC is the work of quite a few people, but I do find it terribly irresponsible that the impact of these deprecations is not outlined for the voters to help their decision making.

In my experience, it would be quite trivial to create an impact analysis for the fast majority (~70%) of the current proposals using PHP_CodeSniffer and PHPCompatibility.

I’d be happy to help get that set up if there is interest in adding such an analysis to the proposals.

Smile,
Juliette

Hi Juliette,

Thanks for raising this.

For the return-in-finally deprecation, I did run an impact analysis.
I just kept it out of the RFC entry itself, partly to keep the entry short, partly because I’d already shared the core of it in
my original pre-RFC message on this list (https://externals.io/message/131393#131393 - which lists all 12 affected sites), and partly
because I hadn’t gotten around to reposting it in this thread yet.

So here it is, for you and for anyone else following along…

I compiled the ~5000 most-installed Composer packages with the patched build and collected every site that triggers the new deprecation.
It shows up in 12 places across 9 packages, about 0.18%.

Reading each one:

Thanks,
Osama

Thanks Osama! And yes, I remember you posting those impact analysis results to the list.
I believe it would be good to include that summary in the RFC text. Would make your proposal the (positive) exception to the rule :wink:

Smile, Juliette

Per the PHP documentation for CURLOPT_PROGRESSFUNCTION [1]:

> deprecated as of cURL 7.32.0. Use CURLOPT_XFERINFOFUNCTION instead.

The cURL page for this option also states that it is deprecated since 7.32.0. [2]

It probably would be good to update the RFC to clarify this.

Sincerely,
Theodore

[1]: PHP: Predefined Constants - Manual
[2]: CURLOPT_PROGRESSFUNCTION

Although libcurl documents `CURLOPT_PROGRESSFUNCTION` and
`CURLOPT_XFERINFOFUNCTION` as separate options, they are effectively
the same kind of API from PHP userland’s perspective: both register a
progress callback and use the same return convention to abort a
transfer. Because of that, ext/curl could internally map
`CURLOPT_PROGRESSFUNCTION` to libcurl’s `CURLOPT_XFERINFOFUNCTION`
instead of introducing a PHP deprecation for the legacy constant.

The only `CURL*` PHP constant we deprecated in PHP was
`CURLOPT_BINARYTRANSFER`[^1], which had very small usage then and was
already a no-op option. In PHP 5.6, six constants[^4] were removed.
Since this constant is used frequently, and we can rewrite it to use
`XFERINFOFUNCTION`, we can simplify things for hundreds of library
maintainers. This is especially true because
`CURLOPT_PROGRESSFUNCTION` and `CURLOPT_XFERINFOFUNCTION` are
practically identical within PHP.

We already maintain BC for constants deprecated in libcurl, but still
support them in PHP without any deprecation notices:

- CURLINFO_HTTP_CODE[^2] (deprecated in libcurl 7.10.8)
- CURLOPT_ENCODING[^3] (deprecated in libcurl 7.21.6)

The only Curl constant I'd propose to deprecate would be
CURLE_OBSOLETE[^5]. It is still declared in PHP but is no longer[^6]
used in libcurl.

[^1]: CURLOPT_BINARYTRANSFER Constant • PHP.Watch
[^2]: CURLINFO_HTTP_CODE Constant • PHP.Watch
[^3]: CURLOPT_ENCODING Constant • PHP.Watch
[^4]: CURL - PHP Codex Search • PHP.Watch
[^5]: CURLE_OBSOLETE Constant • PHP.Watch
[^6]: curl/include/curl/curl.h at master · curl/curl · GitHub

Hi

On 6/22/26 17:58, Juliette Reinders Folmer wrote:

Unfortunately none of the proposals contain a proper impact analysis.

Unless your definition of “proper” differs from mine, this is false. As an example, the “Deprecate using "let" as an identifier” deprecation proposal contains this paragraph:

The analysis performed at part of the let construct (Block Scoping) RFC indicated an insignificant usage of “let” in the wild.

which is more than “none of the proposals”. The same is true for “Deprecate returning from a finally block” proposal.

But as every year:

- Harmful functionality does not become less harmful, just because it is widely used.
- Deprecations are not a breaking change. This is even explicitly written down in the PHP project’s policy as of the PHP: rfc:policy-release-process-update RFC.

A majority of the deprecation messages provide actionable advice to the user, and all of the proposals have a proper justification - even if you might personally disagree with it. As an example, I don't personally agree with the deprecation of metaphone(), see php.internals: Re: [RFC] Deprecate Metaphone Function.

Best regards
Tim Düsterhus

Hi

On 6/22/26 18:38, Bob Weinand wrote:

Also, why would we deprecate CURLOPT_PROGRESSFUNCTION? According to https://grep.app/search?f.lang=PHP&q=CURLOPT_PROGRESSFUNCTION it's quite widely used in widely used libraries, like guzzle and symfony. And I wouldn't know what it's replacement would be?

This looks like an editorial error. The deprecation is only listed in the table of contents, but has no dedicated section.

The TOC entry was added on January, 26th by devnexen: PHP: rfc:deprecations_php_8_6

Best regards
Tim Düsterhus

Tim, please don’t try to gaslight me.

The fact that one out of twentyfive proposals has some vague statement about the impact, without any details of what was analysed or how, without definition of “insignificant”, and without a link to details giving credibility to that statement, only goes to highlight that these proposals lack a proper impact analysis.
I agree though that the “finally block” proposal is the only positive exception to this.

Other than that, I did not express an opinion on the details of the individual proposals, but (as every year) you seem to draw conclusions based on things I never said.
The fact that you even feel the need to point out that “deprecations are not a breaking change” is extremely offensive in and of itself. You should know better.

Please don’t do that.

Smile,
Juliette

On Mon, Jun 22, 2026, 2:16 PM Gina P. Banyard internals@gpb.moe wrote:

Hello internals,

It is this time of year again where we proposed a list of deprecations to add in PHP 8.6:

https://wiki.php.net/rfc/deprecations_php_8_6

As a reminder, this list has been compiled over the course of the past year by different people.

And as usual, each deprecation will be voted in isolation.

We still have a bit of time anyone else to propose additional deprecations, and if you have write access feel free to add them directly to the RFC.
Please note that with the new RFC policy rules the RFC must be finalized and in a “frozen” state by the 13th of July at the latest.

Some deprecations should be non-controversial, others a bit more.
If a deprecation is really controversial, it might warrant its own dedicated RFC or be dropped altogether.

Best regards,

Gina P. Banyard

Hi Gina,

Thank you the RFC.

Overall, everything looks good, however, i object (although not voting) to deprecating in and out, because their position in generics type parameter does not require them to be reserved keyword, and there’s no parser ambiguity. inout on the other hand does make sense to deprecate for potential future inout parameters because there’s an ambiguity with untyped parameters ( in inout $x, is it the type or modifier ).

Cheers,

Seifeddine.

On 2026-06-23 01:13, Gina P. Banyard wrote:

We still have a bit of time anyone else to propose additional deprecations, and if you have write access feel free to add them directly to the RFC.

Is spl_object_hash() still useful? The string it creates used to be quite a bit more complex, but eventually it became equivalent to

str_pad(dechex(spl_object_id($obj)), 16, '0', STR_PAD_LEFT) . '0000000000000000'

I.e., it provides exactly the same content as spl_object_id, but in a much more obtuse way. For anyone _needing_ that format, the polyfill is just above.

I suppose there might be changes in the future which will make the hash more useful (parallelism where objects are created simultaneously and independently), but then it would be spl_object_id() that has trouble coping.

Hi, Gina and Internals

I agree deprecate that "Passing object for $vars parameter of
mb_convert_variables()".

However, I have other opinion.(A little bit)
mb_convert_variable and mb_convert_encoding parameter of $encoding is
different behavior of `$encoding = "auto"`.
If we will decide that mb_convert_variable is deprecate and delete, We
need think that behavior.

Anyway, This deprecate of PHP 8.6 is okay to me.

Regards
Yuya

--
---------------------------
Yuya Hamada (tekimen)
- https://tekitoh-memdhoi.info
- youkidearitai (tekimen) · GitHub
-----------------------------

I would like to add the dechunk filter to the deprecation list, but there is some discussion around how to implement that since it is used internally by the HTTP fopen wrapper.

More information here:
https://github.com/php/php-src/issues/21983
https://github.com/php/php-src/pull/22036
https://github.com/php/php-src/pull/22396/changes

Regards,

Sjoerd Langkemper

On Tue, Jun 23, 2026, at 09:26, Nicolas Grekas wrote:

Please don’t, it’s used in userland also.

Thanks, that is interesting. Do you have more information about this? Where and how is it used? Do you have an example?

Regards,

Sjoerd Langkemper

Le mar. 23 juin 2026, 09:43, Sjoerd Langkemper <sjoerd-php@linuxonly.nl> a écrit :

On Tue, Jun 23, 2026, at 09:26, Nicolas Grekas wrote:

Please don’t, it’s used in userland also.

Thanks, that is interesting. Do you have more information about this? Where and how is it used? Do you have an example?

Regards,

Sjoerd Langkemper

Sure, here is the pointer:
https://github.com/symfony/symfony/blob/dce1b899ab0c0e4cef9159c083ef535387a8db12/src/Symfony/Component/HttpClient/Response/NativeResponse.php#L188