Skip to content

Comments

Fix PHP 8.4 deprecation#157

Merged
sorinsarca merged 1 commit intoopis:3.xfrom
SerheyDolgushev:fix/php84
Jul 8, 2025
Merged

Fix PHP 8.4 deprecation#157
sorinsarca merged 1 commit intoopis:3.xfrom
SerheyDolgushev:fix/php84

Conversation

@SerheyDolgushev
Copy link

@SerheyDolgushev SerheyDolgushev commented Jul 8, 2025

Fixes following PHP 8.4 deprecation for v3:

Deprecated: Opis\Closure\unserialize(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in /srv/vendor/opis/closure/functions.php on line 32

@SerheyDolgushev SerheyDolgushev changed the base branch from master to 3.x July 8, 2025 19:39
@sorinsarca sorinsarca merged commit c017cea into opis:3.x Jul 8, 2025
@SergiiDolgushev
Copy link

@sorinsarca can you please release new v3.6.4 with this fix?

@sorinsarca
Copy link
Member

Not yet, some tests are failing.
Will probably pe 3.7.0 and remove support for really old php versions.

@SergiiDolgushev
Copy link

@sorinsarca please let me know if you would need any help with 3.7.0.

@sorinsarca
Copy link
Member

sorinsarca commented Jul 8, 2025

I think that the simplest way is to change the function signature to:

function unserialize($data, $options = null);

This way I can keep support for older php versions.
To fully support php 8+ code you'll eventually need v4 of opis/closure.

@sorinsarca
Copy link
Member

@SergiiDolgushev if you can make a PR for this I'll merge it and release a new version in minutes (it just so happens that I cannot do the PR myself right now, sorry)

@SergiiDolgushev
Copy link

SergiiDolgushev commented Jul 8, 2025

Sorry, I've just noticed your lattest comments, and submitted #158. Do you think that will work, or would you prefer function unserialize($data, $options = null); signature?

@sorinsarca
Copy link
Member

Nullable types were added in 7.1, so a syntax error is thrown for earlier versions.

@sorinsarca
Copy link
Member

So yes, the easiest way is to remove the type

@SergiiDolgushev
Copy link

Done: #159

@sorinsarca
Copy link
Member

@SergiiDolgushev v3.7.0 was released

@SergiiDolgushev
Copy link

@sorinsarca Thank you very much!!!

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.

3 participants