Skip to content

PHP 8.5 migration guide #4906

Merged
Girgias merged 38 commits into
php:masterfrom
mumumu:php85-migration-guide
Nov 10, 2025
Merged

PHP 8.5 migration guide #4906
Girgias merged 38 commits into
php:masterfrom
mumumu:php85-migration-guide

Conversation

@mumumu

@mumumu mumumu commented Oct 7, 2025

Copy link
Copy Markdown
Member

Based on PHP 8.5 UPGRADE NOTES and past migration guides.

  • TODO

@mumumu mumumu added this to the PHP 8.5 milestone Oct 7, 2025
@mumumu mumumu assigned mumumu and unassigned mumumu Oct 8, 2025
@mumumu mumumu marked this pull request as ready for review October 12, 2025 12:10
@DanielEScherzer

Copy link
Copy Markdown
Member

I forgot to add UPGRADING for FILTER_THROW_ON_FAILURE and the 2 new classes that added, so it wasn't in #4886 originally - I just added that, can you include them here too?

@TimWolla

Copy link
Copy Markdown
Member

php/php-src#20239 might also need to be incorporated

@mumumu

mumumu commented Oct 20, 2025

Copy link
Copy Markdown
Member Author

I forgot to add UPGRADING for FILTER_THROW_ON_FAILURE and the 2 new classes that added, so it wasn't in #4886 originally

Added in 4f86bb5

php/php-src#20239 might also need to be incorporated

Changed in 3d7f6f5

@TimWolla

Copy link
Copy Markdown
Member

php/php-src#20278

@mumumu

mumumu commented Oct 25, 2025

Copy link
Copy Markdown
Member Author

php/php-src#20278

Added in a288458.
However, it is not the UPGRADING file as-is; instead, content based on the RFC wording has been added.

@mumumu mumumu force-pushed the php85-migration-guide branch from 5369184 to 928e2f4 Compare October 25, 2025 11:40

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for starting this! I left a lot of comments that I would like to have addressed. :)

Comment thread appendices/migration85/deprecated.xml
Comment thread appendices/migration85/deprecated.xml
Comment thread appendices/migration85/deprecated.xml Outdated
Comment thread appendices/migration85/deprecated.xml Outdated
Comment on lines +202 to +210
<simpara>
The <link linkend="object.wakeup">__wakeup()</link> magic method of
<interfacename>DateTimeInterface</interfacename>,
<classname>DateTime</classname>, <classname>DateTimeImmutable</classname>,
<classname>DateTimeZone</classname>, <classname>DateInterval</classname>,
and <classname>DatePeriod</classname> has been deprecated in favour of
the <link linkend="object.unserialize">__unserialize()</link> magic method.
<!-- RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods -->
</simpara>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember if this wasn't reverted with the soft deprecation RFC, so this would need to be removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. deleted in eaa8c68.

Comment thread appendices/migration85/deprecated.xml Outdated
Comment on lines +247 to +250
The <constant>MHASH_<replaceable>*</replaceable></constant> constants
have been deprecated. These have been overlooked when the mhash*() function
family has been deprecated per
<!-- RFC: https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family -->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text doesn't make much sense as the RFC which is being linked to is in a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. deleted mhash*() related description in dc23d16.

Comment on lines +185 to +188
The <link linkend="language.oop5.cloning">clone language construct</link>
is now a function and supports reassigning (readonly) properties during
cloning via the new <property>$withProperties</property> parameter.
<!-- RFC: https://wiki.php.net/rfc/clone_with_v2 -->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TimWolla it cannot be disabled via disable_functions right?

Comment thread appendices/migration85/new-features.xml Outdated
Comment thread appendices/migration85/new-features.xml Outdated
Comment thread appendices/migration85/new-features.xml Outdated
Comment thread appendices/migration85/new-features.xml Outdated

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for starting this! I left a lot of comments that I would like to have addressed. :)

@mumumu

mumumu commented Nov 2, 2025

Copy link
Copy Markdown
Member Author

@Girgias

Thanks for all the feedback! I've addressed the points you raised, but I'm not sure how to fix the following.

https://github.com/php/doc-en/pull/4906/files#r2473529673

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More review comments, not sure I correctly identified the review comment you had issues with as the GitHub UI doesn't work...

Comment thread appendices/migration85/deprecated.xml Outdated
Comment thread appendices/migration85/incompatible.xml Outdated
Comment thread appendices/migration85/incompatible.xml Outdated
Comment thread appendices/migration85/incompatible.xml Outdated
Comment thread appendices/migration85/incompatible.xml Outdated
Comment thread appendices/migration85/other-changes.xml Outdated
Comment thread appendices/migration85/other-changes.xml Outdated
Comment thread appendices/migration85/other-changes.xml Outdated
Comment on lines +232 to +240
<simpara>
<function>pg_connect</function> checks if the connection_string argument
contains any null byte.
</simpara>

<simpara>
<function>pg_close_stmt</function> checks if the statement_name argument
contains any null byte.
</simpara>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right so this should be move to the incompatible.xml file as this is a BC change and many of the other value errors are situated there

Comment on lines +483 to +485
<simpara>
Upgraded pcre2lib from 10.44 to 10.46.
</simpara>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was downgraded again due to a bug in PCRE, @ndossche please confirm.

@mumumu

mumumu commented Nov 4, 2025

Copy link
Copy Markdown
Member Author

@Girgias ok, nits markup issues addressed again.

Also, [ValueError|TypeError|Error|Exception] BC break changes are moved in 35ce39c, fed7a9f refs: https://github.com/php/doc-en/pull/4906/files#r2473529673

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay haven't been feeling well.

Lets just merge this now and do more improvements over time.

@Girgias Girgias merged commit ec45af7 into php:master Nov 10, 2025
2 checks passed
@mumumu mumumu deleted the php85-migration-guide branch November 10, 2025 12:31
Crell pushed a commit to Crell/doc-en that referenced this pull request Dec 15, 2025
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants