Skip to content

Conversation

@MrPunyapal
Copy link
Contributor

@MrPunyapal MrPunyapal commented Dec 2, 2025

This patch replaces usages of the deprecated SplObjectStorage::contains() method with SplObjectStorage::offsetExists() to fix a deprecation warning triggered on PHP 8.5.

offsetExists is supported from PHP5 to 8.5 so that will not gonna hurt.
https://www.php.net/manual/en/splobjectstorage.offsetexists.php

@jigar-dhulla
Copy link

If SplObjectStorage::contains() is deprecated, isn't SplObjectStorage::offsetExists() deprecated as well as it's an alias to contains?

@MrPunyapal
Copy link
Contributor Author

MrPunyapal commented Dec 2, 2025

If SplObjectStorage::contains() is deprecated, isn't SplObjectStorage::offsetExists() deprecated as well as it's an alias to contains?

Nope!
https://www.php.net/manual/en/splobjectstorage.offsetexists.php

@MrPunyapal
Copy link
Contributor Author

Phpstan errors are unrelated to this PR.

@stof stof merged commit f0292cc into tijsverkoyen:master Dec 2, 2025
10 of 11 checks passed
@MrPunyapal MrPunyapal deleted the chore/replace-depricated-method-to-recomanded branch December 2, 2025 11:57
@the-pulli the-pulli mentioned this pull request Dec 5, 2025
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