Skip to content

PHPC-2252: Use correct signature for Serializable::unserialize #1440

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

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jun 22, 2023

PHPC-2252

The signature of Serializable::unserialize was changed in PHP 8: the argument was renamed from $serialized to $data, and a string type was added. Since users are unlikely to call this method manually AND be using named arguments on a single-parameter method, this does not have a significant downstream impact. The old signature is kept in place for PHP < 8 as adding the type would violate the original contract (which technically accepts any argument type).

This also allows us to remove a workaround in the function map generation that was necessary due to the renamed parameter (see #1436 (comment) for discussion).

@alcaeus alcaeus self-assigned this Jun 22, 2023
@alcaeus alcaeus merged commit f67484d into mongodb:master Jun 22, 2023
@alcaeus alcaeus deleted the phpc-2252-unserialize-signature branch June 22, 2023 06:59
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.

1 participant