Skip to content

Fix PHP 8.6 macro compatibility#2831

Open
arshidkv12 wants to merge 6 commits into
phpredis:developfrom
arshidkv12:php-8.6
Open

Fix PHP 8.6 macro compatibility#2831
arshidkv12 wants to merge 6 commits into
phpredis:developfrom
arshidkv12:php-8.6

Conversation

@arshidkv12
Copy link
Copy Markdown
Contributor

Comment thread redis_cluster.c
object_properties_init(&cluster->std, class_type);
memcpy(&RedisCluster_handlers, zend_get_std_object_handlers(), sizeof(RedisCluster_handlers));
RedisCluster_handlers.offset = XtOffsetOf(redisCluster, std);
RedisCluster_handlers.offset = offsetof(redisCluster, std);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In PHP 7.4 there is still a bunch of #ifdef soup defending against offsetof not being defined.

In php >= 8.0 they stripped that out, so I'm guessing thisi is fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@michael-grunder
Copy link
Copy Markdown
Member

PR looks good.

There are some PHP 7.4 compatibility errors though

/Users/runner/work/phpredis/phpredis/library.c:4368:9: error: use of undeclared identifier 'ZEND_UNREACHABLE'
 4368 |         ZEND_UNREACHABLE();
      |         ^
/Users/runner/work/phpredis/phpredis/library.c:4435:9: error: use of undeclared identifier 'ZEND_UNREACHABLE'
 4435 |         ZEND_UNREACHABLE();
      |         ^

PHP 7.4 is quite EOL so I'll open an issue about dropping support sometime soon. For now we'll need to stay compatible.

@arshidkv12
Copy link
Copy Markdown
Contributor Author

Sorry... I added code in my localhost. I will push it soon. Thank you

@arshidkv12
Copy link
Copy Markdown
Contributor Author

Please check it

@arshidkv12
Copy link
Copy Markdown
Contributor Author

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