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

Issues with PHP 8.1 nightly build #188

Closed
MarkBaker opened this issue Jun 25, 2021 · 2 comments
Closed

Issues with PHP 8.1 nightly build #188

MarkBaker opened this issue Jun 25, 2021 · 2 comments

Comments

@MarkBaker
Copy link

MarkBaker commented Jun 25, 2021

Description of the problem

Version 2.1.0 is triggering errors against the latest PHP 8.1 nightly build

Example code

Literally just instantiating a new archive with

$options = new \ZipStream\Option\Archive();

Informations

  • ZipStream-PHP version: 2.1.0
  • PHP version: 8.1 (nightly)

Please include any supplemental information you deem relevant to this issue.

This may be an issue with one of our dependencies, looking at the stack trace

/home/runner/work/PhpSpreadsheet/PhpSpreadsheet/vendor/myclabs/php-enum/src/Enum.php:301
/home/runner/work/PhpSpreadsheet/PhpSpreadsheet/vendor/myclabs/php-enum/src/Enum.php:22
/home/runner/work/PhpSpreadsheet/PhpSpreadsheet/vendor/maennchen/zipstream-php/src/Option/Method.php:15
/home/runner/work/PhpSpreadsheet/PhpSpreadsheet/vendor/maennchen/zipstream-php/src/Option/Archive.php:116

The actual error message is:

PHPUnit\Framework\Exception: PHP Fatal error:  During inheritance of JsonSerializable: Uncaught Declaration of MyCLabs\Enum\Enum::jsonSerialize() should be compatible with JsonSerializable::jsonSerialize(): mixed

So it looks like a "clash" between the Enum implementation in MyClabs\Enum and the new Enums in PHP 8.1, but with 8.1 now in its alpha release stages, I thought I'd better bring it to your attention

@NicolasCARPi
Copy link
Collaborator

Well, thank you for bringing it to our attention. I think we'll move to enums from stdlib once 8.1 is released, as the MyClabs\Enum was just a polyfill until the PHP project implement them. It's also possible that MyClabs\Enum will be fixed to not clash with php 8.1 in future releases.

I'm closing this issue as there is no point yet for looking into it, let's see how it evolves, we need to give some time to the ecosystem ;)

Putting this link for us, not for you as you opened it ;)
myclabs/php-enum#144

@MarkBaker
Copy link
Author

Should now be resolved in the latest 1.8.1 release of MyClabs\Enum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants