Skip to content

Conversation

@acelaya
Copy link
Contributor

@acelaya acelaya commented Oct 31, 2025

Q A
Documentation no
Bugfix no
BC Break no
New Feature no
RFC no
QA no

Description

This PR adds support for PHP 8.5, and drops support for PHP 8.1

@acelaya
Copy link
Contributor Author

acelaya commented Oct 31, 2025

I'm looking into this failing test:

1) LaminasTest\Code\Reflection\ParameterReflectionTest::testGetType with data set #6 ('LaminasTest\Code\TestAsset\Cl...dClass', 'selfParameter', 'foo', 'self')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'self'
+'LaminasTest\Code\TestAsset\ClassTypeHintedClass'

Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Looks like ReflectionType::getName() has changed - it's not documented though: https://github.com/php/php-src/blob/php-8.5.0RC3/UPGRADING

@acelaya acelaya force-pushed the php-8.5 branch 4 times, most recently from 9af7379 to 4ed019a Compare October 31, 2025 16:03
Signed-off-by: Alejandro Celaya <alejandrocelaya@gmail.com>
@acelaya
Copy link
Contributor Author

acelaya commented Oct 31, 2025

Looks like ReflectionType::getName() has changed - it's not documented though: https://github.com/php/php-src/blob/php-8.5.0RC3/UPGRADING

How would you suggest proceeding here? Considering the same test would now require different assertions for PHP 8.5 and previous versions?

@alexislefebvre
Copy link

Looks like ReflectionType::getName() has changed - it's not documented though: https://github.com/php/php-src/blob/php-8.5.0RC3/UPGRADING

How would you suggest proceeding here? Considering the same test would now require different assertions for PHP 8.5 and previous versions?

There are several ways:

@gsteel
Copy link
Member

gsteel commented Oct 31, 2025

@acelaya - If you can also upgrade PHPUnit to 11.x here too, we'll lose a load of deprecations too. Normally, I'd suggest also adding failOnDeprecation and failOnPhpUnitDeprecation to phpunit.xml, but only if the changes required are minimal - we can drop all calls to ReflectionProperty::setAccessible() because it's a no-op since 8.2

@gsteel gsteel added this to the 4.17.0 milestone Oct 31, 2025
@gsteel gsteel added this to PHP 8.5 Oct 31, 2025
@github-project-automation github-project-automation bot moved this to Todo in PHP 8.5 Oct 31, 2025
@gsteel gsteel added Enhancement Dependencies Updates and changes to dependencies QA Quality assurance tasks such as static analysis improvements labels Oct 31, 2025
@alexislefebvre

This comment was marked as resolved.

Signed-off-by: Alejandro Celaya <alejandrocelaya@gmail.com>
@acelaya
Copy link
Contributor Author

acelaya commented Nov 1, 2025

@acelaya - If you can also upgrade PHPUnit to 11.x here too, we'll lose a load of deprecations too. Normally, I'd suggest also adding failOnDeprecation and failOnPhpUnitDeprecation to phpunit.xml, but only if the changes required are minimal - we can drop all calls to ReflectionProperty::setAccessible() because it's a no-op since 8.2

I'm trying to do this, but it seems it might require updating psalm to v6 first.

The problem is that psalm 5 requires sebastian/diff: ^4.0 || ^5.0, while phpunit 11 requires sebastian/diff: ^6.0.

Would you be ok separating the update to PHPUnit 11 out of this PR, until the project has been updated to psalm 6? The only problem is that the deprecation warnings are making the tests be marked as failed, even though they are actually passing now.

EDIT: Actually, I could simply remove those setAccessible(...) calls. That should solve the deprecation warnings at least.

Signed-off-by: Alejandro Celaya <alejandrocelaya@gmail.com>
Signed-off-by: Alejandro Celaya <alejandrocelaya@gmail.com>
Signed-off-by: Alejandro Celaya <alejandrocelaya@gmail.com>
@acelaya
Copy link
Contributor Author

acelaya commented Nov 1, 2025

Ok, CI is green now. I did the minimum changes to get it working.

As I mentioned here, I could not update to PHPUnit 11 as it has a shared dependency with psalm, but with no overlapping in version constraints. The project probably needs to update to psalm 6 first.

@acelaya acelaya mentioned this pull request Nov 1, 2025
19 tasks
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Thanks @acelaya 👍

@gsteel gsteel self-assigned this Nov 1, 2025
@gsteel gsteel changed the title Add support for PHP 8.5 Add support for PHP 8.5, Remove support for PHP 8.1 Nov 1, 2025
@gsteel gsteel merged commit 00c6aee into laminas:4.17.x Nov 1, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in PHP 8.5 Nov 1, 2025
@acelaya acelaya deleted the php-8.5 branch November 1, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dependencies Updates and changes to dependencies Enhancement QA Quality assurance tasks such as static analysis improvements

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants