-
Notifications
You must be signed in to change notification settings - Fork 370
PHP 8.5 support #2950
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
base: trunk
Are you sure you want to change the base?
PHP 8.5 support #2950
Conversation
|
I still need to recompile older PHP versions to fix Apply php-chunk-alloc-zend-assert.patch to PHP versions older than PHP 8.3 and resolve the failing tests. |
| if [[ "${PHP_VERSION:0:3}" < '8.3' ]]; then \ | ||
| git apply --no-index /root/php-chunk-alloc-zend-assert.patch -v; \ | ||
| elif [[ "${PHP_VERSION:0:3}" == '8.3' ]]; then \ | ||
| git apply --no-index /root/php-chunk-alloc-zend-assert-8.3.patch -v; \ | ||
| elif [[ "${PHP_VERSION:0:3}" == '8.4' ]]; then \ | ||
| git apply --no-index /root/php-chunk-alloc-zend-assert-8.4.patch -v; \ | ||
| elif [[ "${PHP_VERSION:0:3}" == '8.5' ]]; then \ | ||
| git apply --no-index /root/php-chunk-alloc-zend-assert-8.5.patch -v; \ | ||
| fi && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While adding the PHP 8.5 patch, I noticed that patches for PHP versions before 8.3weren't applied.
| # Add the dummy opcache_module.c to the list of files to build for PHP < 8.4.0. | ||
| # PHP 8.5 made OPcache a non-optional part of PHP https://wiki.php.net/rfc/make_opcache_required | ||
| if [[ "${PHP_VERSION:0:1}" -lt "8" || ("${PHP_VERSION:0:1}" -eq "8" && "${PHP_VERSION:2:1}" -lt "4") ]]; then \ | ||
| /root/replace.sh 's/shared_alloc_mmap.c/shared_alloc_mmap.c opcache_module.c/g' /root/php-src/ext/opcache/config.m4; \ | ||
| fi; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP 8.5 made OPcache a non-optional part so we don't need to add the dummy opcache_module.c file to the list of files to build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @zaerl – any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @zaerl – any thoughts?
It is now a static lib. Having a -lt 5 check is ok. https://github.com/php/php-src/pull/18660/files#diff-fba8aed1e512099e6635bd4d9ffd939e0489105bc6b2c68d0bfe1abb0ee1007cL29
|
I'm currently working on compiling XDebug for PHP 8.5. |
|
Xdebug and Intl are now compiling. Next step I need to remove |
| OPCACHE_FLAGS=""; \ | ||
| if [[ "${PHP_VERSION:0:1}" -ge "8" && "${PHP_VERSION:2:1}" -ge "5" ]]; then \ | ||
| OPCACHE_FLAGS="--enable-opcache --disable-opcache-jit --disable-huge-code-pages"; \ | ||
| else \ | ||
| OPCACHE_FLAGS="--disable-opcache"; \ | ||
| fi; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because PHP 8.5 made Opcache required, we need to enable it during Intl compilation.
| OPCACHE_FLAGS=""; \ | ||
| if [[ "${PHP_VERSION:0:1}" -ge "8" && "${PHP_VERSION:2:1}" -ge "5" ]]; then \ | ||
| OPCACHE_FLAGS="--enable-opcache --disable-opcache-jit --disable-huge-code-pages"; \ | ||
| else \ | ||
| OPCACHE_FLAGS="--disable-opcache"; \ | ||
| fi; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because PHP 8.5 made Opcache required, we need to enable it during Xdebug compilation.
| if [[ "${PHP_VERSION:0:1}" -ge "8" && "${PHP_VERSION:2:1}" -ge "5" ]]; then \ | ||
| export XDEBUG_BRANCH="master"; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO change this to. xdebug_3_5 once it's released.
For this PR we could use 3.5.0alpha3.
| if [[ "${PHP_VERSION:0:1}" -ge "8" && "${PHP_VERSION:2:1}" -ge "5" ]]; then \ | |
| export XDEBUG_BRANCH="master"; \ | |
| if [[ "${PHP_VERSION:0:1}" -ge "8" && "${PHP_VERSION:2:1}" -ge "5" ]]; then \ | |
| export XDEBUG_BRANCH="xdebug_3_5"; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamziel would you recommend we use the 3.5.0alpha3 version of Xdebug here, or wait with PHP 8.5 support until Xdebug releases 3.5?
I'm thinking of shipping it with 3.5.0alpha3 if everything works correctly and recompile only Xdebug once 3.5 is released.
| curl_setopt($ch, CURLOPT_TCP_NODELAY, 0); | ||
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | ||
| $result = curl_exec($ch); | ||
| curl_close($ch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since PHP 8.0 curl_close isn't required as the handle is released automatically when the CurlHandle object falls out of scope or is garbage-collected. (source)
I'm not sure if I should add curl_close for PHP 7 tests, or if it's ok to leave it as-is.
🚧 WIP
What is this PR doing?
Adds PHP 8.5 to Playground.
Additionally, it solves a bug where the php-chunk-alloc-zend-assert patch wasn't correctly applied to PHP versions before PHP 8.3.
Testing Instructions
/phpinfo.php, confirm the php version it 8.5nx dev playground-cli server --php=8.5