Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.3 support #607

Closed
Tracked by #7153
vishalkhode1 opened this issue Aug 22, 2023 · 12 comments
Closed
Tracked by #7153

PHP 8.3 support #607

vishalkhode1 opened this issue Aug 22, 2023 · 12 comments

Comments

@vishalkhode1
Copy link

What's the plan to provide support for PHP 8.3, which is scheduled for release on November 23, 2023, with the first RC version set to be release on August 31, 2023.

@stof
Copy link
Member

stof commented Aug 22, 2023

It will depend on community contributions to identify which new features of PHP 8.3 are requiring changes in Prophecy to allow doubling them.
If you find incompatibilities, please report them as issues in the issue tracker (one issue per problem please, not a generic one mixing all compat issues as it makes it harder to track resolution). And then, if you have time to contribute a fix, it is even better.

To test things, you can use the --ignore-platform-req=php+ flag of composer to allow ignoring the upper bound of the PHP requirement to allow installing it on PHP 8.3 (that's exactly what this flag is about).

@rajeshreeputra
Copy link
Contributor

rajeshreeputra commented Aug 24, 2023

Created PR attaching results:
Screenshot 2023-08-24 at 12 34 16 PM

Also Created PR for phpspec/phpspec plugin for the same.
Screenshot 2023-08-24 at 12 59 11 PM

@stof
Copy link
Member

stof commented Aug 24, 2023

@rajeshreeputra having a green CI does not mean that we support PHP 8.3 though. It means we support code using older features when running on 8.3. Support for language features added in PHP 8.3 is not covered by the existing testsuite.

@Ocramius
Copy link

I think #[\Override] may need some codegen adjustments here:

Selection_461

https://wiki.php.net/rfc

@stof
Copy link
Member

stof commented Nov 21, 2023

Given that the Override attribute is not required when overriding a method (even when the parent method is itself using the attribute), I don't think it requires any code gen change.

@Wirone
Copy link
Contributor

Wirone commented Nov 21, 2023

From my perspective, what could be interesting from mocking library's perspective is:

  • ability to mark anonymous class as readonly
  • ability to overwrite class properties during cloning
  • typed class constants maybe?

All of them (at least first 2) in terms of optimising generated code. But it's a wild guess only, I don't know about Prophecy's internal much.

@stof
Copy link
Member

stof commented Nov 21, 2023

Prophecy does not rely on anonymous classes (and currently does not support mocking readonly classes anyway as its internal implementation currently requires a mutable property in the mock class)

@stof
Copy link
Member

stof commented Nov 21, 2023

typed class constants should not affect us as the generated mock class does not redefine constants.

@Jean85
Copy link
Contributor

Jean85 commented Dec 1, 2023

Ok, so the conclusion is that we don't need any additional work to support PHP 8.3, right?

@soyuka
Copy link

soyuka commented Dec 5, 2023

let's just bump the supported version then?

@andypost
Copy link

andypost commented Dec 7, 2023

Drupal also awaiting of new release with PHP 8.3.* support https://www.drupal.org/project/drupal/issues/3406622

@stof
Copy link
Member

stof commented Dec 7, 2023

1.18.0 has been released and includes it.

@stof stof closed this as completed Dec 7, 2023
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

No branches or pull requests

8 participants