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

Add support for printing Enums when using PHP 8.1 #15

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from

Conversation

gabrielanhaia
Copy link

Change Log

Added

    - Support for printing Enums when using PHP 8.1

Fixed

Changed

    Now it's possible to print Enums, however We will need a new version (probably) for backward compatibility.

Removed

Deprecated

Security


Description

  • It was implemented the possibility to print Enums when using PHP8.1+
  • I changed the minimum version of PHP to 8.1 in the composer.json file, probably We will need a 4.x version or something like that to keep the previous versions working.
  • If you take a look at my PR you will see that the return of \gettype in the case of an Enum is still an object for PHP. That is why I had to combine the \get_class and this new nice PHP function enum_exists

@gabrielanhaia
Copy link
Author

@norberttech Proposition of an improvement now that PHP 8.1 is out there

@norberttech
Copy link
Member

norberttech commented Dec 2, 2021

Do we really need to break BC to support enums? It might be better to probably just check if method enum_exists and then use it to check if given value is an enum and use it.
Could you also add 8.1 to testsuite matrix in github action workflow files?

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