-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Safe\DateTimeImmutable is incompatible with PHP 8 #250
Comments
I need to wait for the doc to be updated to php8 before being able to release safe2.0 |
Related to https://bugs.php.net/bug.php?id=79975 |
@Kharhamel Is there a timeline for fixing this? Now the 1.3.3-release claims to be compatible with PHP 8 (composer.json: >=7.2), I was surprised getting exceptions after upgrading PHP. Should the constraint be changed to ^7.2? Of is the incompatibility a bug and should it be fixed (for example with the PR by @janatjak)? |
Same problem here. This class is not compatible with PHP 8, so the version constraint should be changed. |
@Kharhamel How can we help moving this forward? The incompatibility is, unfortunately, blocking our upgrade to PHP 8. |
I am so sorry, I really didn't have time to work on safe in the last few months. I actually created an separated project for the php8 version: https://github.com/thecodingmachine/safe8 Trying to manage the update to 8 on this project was just too dangerous because some huge libraries use this package. It isn't ready yet, I have to update the rector directory to the lastest version, then hook that into packagist, then properly mark thecodingmachine/safe as deprecated. Problem is I am not great with rector |
I have never used Rector, unfortunately. But, certainly when you want to deprecate the current repo, I think you should correct the required PHP version in composer.json. In the current situation Composer allows to update PHP, while it is not compatible. |
By the way, releasing the PHP 8-version of this bundle as version 2.0.0 should not break existing installations, isn't it? Major versions are allowed to have BC-breaks, everybody using it on PHP 7 should have added a constraint like ^1.3, making it not automatically upgrade to 2.0.0. |
@Kharhamel I was not aware there is a specific version for PHP 8. You should add a note at the top of the readme of the current version to inform people to switch to safe8 when using php 8. And @tjveldhuizen is correct, the current approach is problematic when a project/library is designed to run on PHP 7 and PHP 8 because both packages will conflict. I support @tjveldhuizen suggestion on making safe8 the version 2 so a dependency like |
Actually, I think making a separate repo for php8 will cause even more headache for other packages requiring this library and want to support php7 and php8. what should they put in their why don't you just let composer sort that out? Afaik you don't even have to tag a major version. If you release a version which requires |
I am on the +1 list to have a new major bump for PHP 8. Any particular reason why a new major bump in this package was not an option? Having a few more insights would be nice :-) |
I hope this issue can be resolved somehow. Thank you very much for hard work! |
I'm sorry, I'm jumping in late here but... Why can't we just fix this with what I'm proposing in #278? |
That would really be awesome. That's the only thing that keeps us from PHP8 in some packages. Would it be possible to merge that, even though this library is deprecated, @Kharhamel ? Thank you very much! |
This has been solved in #278 |
Results in the following on PHP 8:
Tested on v1.3.2.
The text was updated successfully, but these errors were encountered: