Skip to content

Replace XtOffsetOf() with offsetof() for PHP 8.6#2008

Open
andypost wants to merge 1 commit intomongodb:v2.xfrom
andypost:php86
Open

Replace XtOffsetOf() with offsetof() for PHP 8.6#2008
andypost wants to merge 1 commit intomongodb:v2.xfrom
andypost:php86

Conversation

@andypost
Copy link
Copy Markdown

@andypost andypost commented Apr 30, 2026

PHP 8.6 removed XtOffsetOf(), which was an alias for the standard C offsetof() macro. Replace all usages with offsetof() directly.

replace 's/XtOffsetOf/offsetof/g'

ref php/php-src@7114314

@andypost andypost requested a review from a team as a code owner April 30, 2026 19:09
@andypost andypost requested review from GromNaN and removed request for a team April 30, 2026 19:09
@andypost andypost changed the title fi PHP 8.6 compatibility fix PHP 8.6 compatibility Apr 30, 2026
@andypost
Copy link
Copy Markdown
Author

Looks the failure is preexisting

Copy link
Copy Markdown
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

Thank you very much for taking care of this update. We really appreciate it.

Comment thread src/phongo_classes.h Outdated
@andypost andypost changed the title fix PHP 8.6 compatibility Replace XtOffsetOf() with offsetof() for PHP 8.6 Apr 30, 2026
PHP 8.6 removed XtOffsetOf from php_stdint.h, so use the standard offsetof macro for object fetch helpers.
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