Skip to content
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

php 8.2 compatibility #493

Merged
merged 1 commit into from
Feb 3, 2023
Merged

php 8.2 compatibility #493

merged 1 commit into from
Feb 3, 2023

Conversation

rbro
Copy link
Contributor

@rbro rbro commented Dec 17, 2022

This is related to #492. With this change, I'm able to get a clean compile of v8js in PHP 8.2. The change is documented in https://github.com/php/php-src/blob/PHP-8.2/UPGRADING.INTERNALS.

@rbro rbro mentioned this pull request Dec 17, 2022
@stesie
Copy link
Member

stesie commented Dec 19, 2022

Hej @rbro, thanks for your PR.

The proposed change breaks the build with PHP versions 8.0 and 8.1, doesn't it?

@rbro
Copy link
Contributor Author

rbro commented Dec 28, 2022

Yes, thanks, good point. I'm not familiar with PHP extensions to know how to have a return type of a function be different based on PHP version. Is there a way to do that?

@stesie
Copy link
Member

stesie commented Jan 11, 2023

Sorry for the late response.

You can achieve this using C++ preprocessor directives like

#if PHP_VERSION_ID < 80200
static int v8js_v8object_get_closure
#else
static zend_result v8js_v8object_get_closure
#endif

stesie added a commit that referenced this pull request Feb 3, 2023
@stesie stesie merged commit 1175617 into phpv8:php8 Feb 3, 2023
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