Skip to content

Make bson-enum_error resilient to PHP 8.6 interface handler order#1977

Merged
GromNaN merged 1 commit intomongodb:v2.2from
GromNaN:backport-1953-to-v2.2
Apr 8, 2026
Merged

Make bson-enum_error resilient to PHP 8.6 interface handler order#1977
GromNaN merged 1 commit intomongodb:v2.2from
GromNaN:backport-1953-to-v2.2

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented Apr 8, 2026

Backport of #1953 to v2.2.

PHP is calling the interface_gets_implemented handlers in a different order since php/php-src#18622

The Persistable interface extends Unserializable which is the one that cannot be implemented.

…ngodb#1953)

PHP is calling the interface_gets_implemented handlers in a different order
Copilot AI review requested due to automatic review settings April 8, 2026 07:50
@GromNaN GromNaN requested a review from a team as a code owner April 8, 2026 07:50
@GromNaN GromNaN requested review from alcaeus and removed request for a team April 8, 2026 07:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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\Persistable or MongoDB\BSON\Unserializable in 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.

@GromNaN GromNaN enabled auto-merge (squash) April 8, 2026 08:27
@GromNaN GromNaN merged commit 5726e85 into mongodb:v2.2 Apr 8, 2026
47 checks passed
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