Skip to content

Conversation

@alexpott
Copy link

Having an upper bound on the PHP constraint makes it hard for an dependency to get ready for the next version of PHP. This is especially true when you are nearly always a dev dependency used for testing. Making it easy to run tests against upcoming PHP versions is good for the PHP community.

@stof
Copy link
Member

stof commented Nov 13, 2025

you can already use --ignore-platform-req=php+ in Composer to ignore the upper bound of the PHP requirement, when you want to test against upcoming PHP versions (that's exactly the use case for the feature in Composer).

Having an upper bound on the PHP requirement in Prophecy is an intended choice. The nature of this library means that it is often affected by changes done in PHP minor versions (when adding new features impacting what can appear in method signatures).

So -1 for this change.

@alexpott
Copy link
Author

Yes there are ways - but my test suite does all sorts of mad stuff with composer too so this just adds noise. It feels like an unnecessary barrier to getting contributions to prophecy.

Also this time with PHP 8.5 I think there were no changes ... right?

@stof
Copy link
Member

stof commented Nov 13, 2025

And PHP 8.5 is already supported (in the dev version for now, as I haven't done a release yet, but anyway, testing upcoming PHP versions without allowing using upcoming versions of your dependencies does not make sense)

@stof
Copy link
Member

stof commented Nov 13, 2025

Summary of impact for PHP 8.x releases (I don't have the history for PHP 7.x releases as we did not have tags to identify such issues yet at that time):

  • 8.0: impact on Prophecy (static return type, false return type, union types, mixed type, named arguments, etc...)
  • 8.1: impact on Prophecy (enums as default values, intersection types, never return type, object as default values, etc...)
  • 8.2: impact on Prophecy (readonly classes, DNF types, true return type, etc...)
  • 8.3: no impact (also related to the fact that PHP 8.3 has less impactful new features at all in its release notes)
  • 8.4: impact on Prophecy (nullable argument changes)
  • 8.5: no impact on Prophecy

As you see, we have more cases being impacted than cases not being impacted. The fact that PHP 8.5 does not have impact is more luck than a pattern we can rely on.

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.

2 participants