Summary
The current NC33 version of mail_roundcube declares PHP 8.4 as its minimum supported PHP version:
<php min-version="8.4" max-version="8.5" />
This prevents installation on Nextcloud 33 installations running PHP 8.3, including Nextcloud AIO 33.0.6.
The current source contains a small number of PHP 8.4-only direct dereferences of new expressions. Rewriting those expressions using the PHP 8.3-compatible parenthesized syntax and lowering the metadata requirement to PHP 8.3 is sufficient for the application to build and run successfully.
Steps to reproduce
- Run Nextcloud 33 on PHP 8.3.
- Attempt to install or enable current mail_roundcube 1.3.0.
- Observe that the app dependency metadata requires PHP >= 8.4.
- Lower only the metadata constraint and lint the current PHP source with PHP 8.3.
- Observe PHP 8.4-only direct
new dereference syntax.
Expected behavior
If mail_roundcube does not otherwise depend on PHP 8.4 functionality, the NC33 release should support PHP 8.3.
This is particularly useful because Nextcloud 33 is being deployed with PHP 8.3, including by Nextcloud AIO.
Actual behavior
appinfo/info.xml currently declares:
<php min-version="8.4" max-version="8.5" />
Current source also includes direct dereferencing such as:
new Response()->withStatus($httpStatusCode)->getReasonPhrase();
and:
new $phpType()->getName();
These can be expressed compatibly with PHP 8.3 as:
(new Response())->withStatus($httpStatusCode)->getReasonPhrase();
and:
(new $phpType())->getName();
Cause
The NC33 work introduced PHP 8.4 syntax and raised the minimum PHP version, although the affected expressions do not appear to require PHP 8.4 functionality.
The same operations can be expressed using syntax supported by PHP 8.3.
Proposed fix
- Replace the PHP 8.4-only direct dereferences of
new expressions with equivalent PHP 8.3-compatible parenthesized expressions.
- Change the application dependency to:
<php min-version="8.3" max-version="8.5" />
I tested a local build with these compatibility changes on PHP 8.3.32.
The resulting application successfully:
- installs and enables on Nextcloud 33.0.6;
- loads its administration and personal settings;
- saves per-user Roundcube credentials;
- performs the server-side Roundcube login; and
- loads the authenticated Roundcube iframe.
Environment
- Nextcloud: 33.0.6
- PHP: 8.3.32
- mail_roundcube: 1.3.0 / current NC33 source
- Roundcube: 1.7.3
- Deployment: Nextcloud AIO
Summary
The current NC33 version of mail_roundcube declares PHP 8.4 as its minimum supported PHP version:
This prevents installation on Nextcloud 33 installations running PHP 8.3, including Nextcloud AIO 33.0.6.
The current source contains a small number of PHP 8.4-only direct dereferences of
newexpressions. Rewriting those expressions using the PHP 8.3-compatible parenthesized syntax and lowering the metadata requirement to PHP 8.3 is sufficient for the application to build and run successfully.Steps to reproduce
newdereference syntax.Expected behavior
If mail_roundcube does not otherwise depend on PHP 8.4 functionality, the NC33 release should support PHP 8.3.
This is particularly useful because Nextcloud 33 is being deployed with PHP 8.3, including by Nextcloud AIO.
Actual behavior
appinfo/info.xmlcurrently declares:Current source also includes direct dereferencing such as:
and:
These can be expressed compatibly with PHP 8.3 as:
and:
Cause
The NC33 work introduced PHP 8.4 syntax and raised the minimum PHP version, although the affected expressions do not appear to require PHP 8.4 functionality.
The same operations can be expressed using syntax supported by PHP 8.3.
Proposed fix
newexpressions with equivalent PHP 8.3-compatible parenthesized expressions.I tested a local build with these compatibility changes on PHP 8.3.32.
The resulting application successfully:
Environment