Sitelet https://github.com/phpredis/phpredis/pull/1283
Skip to content

Use zend_string macros to make it compile against PHP 7.3-dev - #1283

Closed
fmk wants to merge 6 commits into
phpredis:developfrom
fmk:develop
Closed

fmk wants to merge 6 commits into
phpredis:developfrom
fmk:develop

Conversation

@fmk

@fmk fmk commented Dec 13, 2017

Copy link
Copy Markdown

The default branch was showing warnings when compiling with PHP 7.3-dev and the session handler was no working. Adding ZSTR_VAL() and ZSTR_LEN() macros in 3 lines fixed the problems.

@yatsukhnenko

Copy link
Copy Markdown
Member

@fmk thanks! But this change isn't compatible with all previous versions of PHP.

@fmk

fmk commented Dec 15, 2017

Copy link
Copy Markdown
Author

I have tested this with PHP 7.1, 7.2 and 7.3-dev and they all work. What are the errors?

@fmk

fmk commented Dec 15, 2017

Copy link
Copy Markdown
Author

I swapped the logic for checking the version. It should now compile with version 5x and 7.x.

Comment thread redis_session.c
if (url->query != NULL) {
array_init(&params);

#if (PHP_MAJOR_VERSION == 7) && (PHP_MINOR_VERSION > 2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMHO, using PHP_VERSION_ID is simpler (and will take care of PHP 8)

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.

Agree with @remicollet , something like #if (PHP_VERSION_ID < 70300) would be much better

@yatsukhnenko

Copy link
Copy Markdown
Member

@fmk Could you modify your PR to use PHP_VERSION_ID and squash commits? I'm going to merge this and release 3.1.5 as stable on PECL site.

yatsukhnenko added a commit that referenced this pull request Dec 20, 2017
PHP >=7.3.0 uses zend_string to store `php_url` elements.
@yatsukhnenko

Copy link
Copy Markdown
Member

I've made changes by myself. Thanks!

yatsukhnenko added a commit that referenced this pull request Dec 20, 2017
PHP >=7.3.0 uses zend_string to store `php_url` elements.
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