Skip to content

fix: fix object compare result php74 != bc - #84

Merged
zeriyoshi merged 5 commits into
14.xfrom
fix_obj_compare
Jun 10, 2026
Merged

fix: fix object compare result php74 != bc#84
zeriyoshi merged 5 commits into
14.xfrom
fix_obj_compare

Conversation

@zeriyoshi

Copy link
Copy Markdown
Collaborator

require bump 14.x

@zeriyoshi zeriyoshi self-assigned this Jun 8, 2026
Copilot AI review requested due to automatic review settings June 8, 2026 11:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix mismatches between PHP 7.4 native object comparison behavior and the colopl_bc compatibility layer, and to add regression tests around the compare diagnostics modes to ensure objects aren’t replaced during comparison.

Changes:

  • Updates the PHP 7.4 compare implementation to enable “native snapshot compare” in more cases (including certain safe objects) and adds a std-object fast-path comparison.
  • Adds PHPT regression tests for compare diagnostics in log and deprecated modes.
  • Includes minor refactors/touch-ups in array key/data compare helpers while adjusting compare internals.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
ext/colopl_bc_php74.c Adjusts legacy compare behavior and snapshot eligibility logic for PHP 7.4 comparisons.
ext/tests/php74/object_compare_log_snapshot_log.phpt Adds a regression test for log-mode diagnostics without object replacement.
ext/tests/php74/object_compare_log_snapshot_deprecated.phpt Adds a regression test for deprecated-mode diagnostics without object replacement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ext/colopl_bc_php74.c Outdated
Comment thread ext/colopl_bc_php74.c Outdated
Comment thread ext/colopl_bc_php74.c Outdated
Comment thread ext/colopl_bc_php74.c Outdated
Comment on lines +32 to +37
before a:1
before b:2
Incompatible compare detected in %s on line %d
bool(true)
after a:1
after b:2
Comment on lines +32 to +38
before a:1
before b:2

Deprecated: Colopl\ColoplBc\Php74\eq(): Incompatible compare detected in %s on line %d
bool(true)
after a:1
after b:2
zeriyoshi and others added 4 commits June 10, 2026 13:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@zeriyoshi
zeriyoshi changed the base branch from main to 14.x June 10, 2026 05:36
@zeriyoshi
zeriyoshi merged commit 78f8f1f into 14.x Jun 10, 2026
120 checks passed
@zeriyoshi
zeriyoshi deleted the fix_obj_compare branch June 10, 2026 05:37
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.

2 participants