php-to-string
php-to-string copied to clipboard
Add support for printing Enums when using PHP 8.1
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
\gettypein the case of an Enum is still anobjectfor PHP. That is why I had to combine the\get_classand this new nice PHP functionenum_exists
@norberttech Proposition of an improvement now that PHP 8.1 is out there
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?