🚀 PHP 8.4 has arrived in master (to be Nextcloud 31 Hub 10) of Nextcloud Server

:wave: PHP 8.4

just now PHP 8.4 has arrived in master of Nextcloud Server (external storage support is missing but coming soon, ref PHP 8.4 external storages support by nickvergessen · Pull Request #49151 · nextcloud/server · GitHub ).
Feel free to start testing your app already for compatibility.

:test_tube: Testing on CI

If you use the workflows from our organisation repository, that will happen out of the box as they read the lib/versioncheck.php from server:

If not, you can manually adjust your workflows or migrate to those templated workflow templates for named repository.

:recycle: Common things to look out for

The most known code adjustment that is needed is the following error:

Implicitly marking parameter $var as nullable is deprecated, the explicit nullable type must be used instead

This happens for primitives as well as classes. The fix is quite simple, see this 3rdparty PR as an example:

Other things I noticed:

Happy testing

3 Likes

We are now a good 10 months further and there are still a multitude of implicit NULL declarations in apps code, specially in 3rdparty code

You can simply use this patch tool:

phpscan_fix_nullable.php

.. that finds all cases of implicit NULL declarations and can fix them in two ways:
both in the short form:

?type $x = null

and in union syntax:

type|null $x = null

you can simply patch your entire code with the tool as described in the → README.
The result is functioning code and a quiet logger.
You can revert the changes, simply run it wirth --undo

I hope you’ll find the tool valuable!

Much and good luck,


ernolf