-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix PHP 7 compatibility #23
Conversation
Notice, run-tests.php doesn't have to be in git, you can remove it and add it to .gitignore |
The main issue is that I haven't found a easy wait to create a STRING without copy... |
Previous commit is an example about fixing this.... |
Any feedback on this PR ? |
Hi Remi, And thanks a lot for this! A few comments, though. Introducing The double allocation is a bit annoying. And it renders |
Yes, this is a quick fix, and of course, I don't know enough of libsodium to do the perfect fix. There is a difficult choice with zend_string,
I don't see simple way to use zend_string and get rid of #if PHP_MAJOR_VERSION < 7, or perhaps by providing a zend_string for PHP < 7 I think keeping INT_MAX is probably enought for a few years ;) |
What do you think of rev 5134347 ? Code really looks like PHP 7 code, all managed by the compatibility layer. |
Waiting for your feedback before trying to remove all remaining call to _RETURN_STRINGL |
Rebased on 0.1.3 |
Finally merged, with minor changes. Thanks a ton for your help, Remy! |
Probably could be improved, but initial PHP 7 support seems OK.