Make bson-enum_error resilient to PHP 8.6 interface handler order#1977
Merged
GromNaN merged 1 commit intomongodb:v2.2from Apr 8, 2026
Merged
Make bson-enum_error resilient to PHP 8.6 interface handler order#1977GromNaN merged 1 commit intomongodb:v2.2from
GromNaN merged 1 commit intomongodb:v2.2from
Conversation
…ngodb#1953) PHP is calling the interface_gets_implemented handlers in a different order
There was a problem hiding this comment.
Pull request overview
Updates BSON enum error PHPT expectations to tolerate PHP 8.6’s changed interface_gets_implemented handler order, where enums attempting to implement MongoDB\BSON\Persistable may now fail against either Persistable or its parent Unserializable.
Changes:
- Switch PHPT expectations from
--EXPECTF--to--EXPECTREGEX--for the relevant enum/Persistable error tests. - Accept either
MongoDB\BSON\PersistableorMongoDB\BSON\Unserializablein the fatal error message to keep tests stable across PHP versions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/bson/bson-enum_error-003.phpt | Makes expected fatal error resilient to interface handler order by matching Persistable or Unserializable. |
| tests/bson/bson-enum_error-004.phpt | Same resilience update for backed enums implementing Persistable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alcaeus
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #1953 to v2.2.
PHP is calling the
interface_gets_implementedhandlers in a different order since php/php-src#18622The
Persistableinterface extendsUnserializablewhich is the one that cannot be implemented.