Skip to content

Conversation

@bgrgicak
Copy link
Collaborator

@bgrgicak bgrgicak commented Nov 27, 2025

🚧 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

  1. Go to http://localhost:5400/website-server/ and switch the PHP version to 8.5.
  2. Confirm that WordPress is functional and you can update the site in the site editor
  3. Go to /phpinfo.php, confirm the php version it 8.5
  4. Start Playground CLI nx dev playground-cli server --php=8.5
  5. Confirm that WordPress is functional and you can update the site in the site editor
  6. Go to PHP info, confirm the php version it 8.5

@bgrgicak
Copy link
Collaborator Author

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.

Comment on lines +387 to +395
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 && \
Copy link
Collaborator Author

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.

Comment on lines 109 to 113
# 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; \
Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cc @zaerl – any thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bgrgicak
Copy link
Collaborator Author

I'm currently working on compiling XDebug for PHP 8.5.

@adamziel
Copy link
Collaborator

@bgrgicak feel free to poke @mho22 about XDebug

@bgrgicak
Copy link
Collaborator Author

bgrgicak commented Nov 28, 2025

Xdebug and Intl are now compiling. Next step I need to remove curl_close from tests as it's deprecated in PHP 8.5.

Comment on lines +63 to +68
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; \
Copy link
Collaborator Author

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.

Comment on lines +55 to +60
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; \
Copy link
Collaborator Author

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.

Comment on lines 104 to 105
if [[ "${PHP_VERSION:0:1}" -ge "8" && "${PHP_VERSION:2:1}" -ge "5" ]]; then \
export XDEBUG_BRANCH="master"; \
Copy link
Collaborator Author

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.

Suggested change
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"; \

Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants