Commit 10277ed
authored
PHP 8.5 support (#2950)
🦄 **TIP** To review code changes in this PR open [Files change using
this
link](https://github\.com//pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs)
it will hide all the compiled files, so you can see the actual code
changes without GitHub unicorns.
## What is this PR doing?
Adds PHP 8.5 to Playground.
Additionally, it [solves a bug where the php-chunk-alloc-zend-assert
patch](https://github\.com//pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs#r2570571617)
wasn't correctly applied to PHP versions before PHP 8.3.
## Implementation Details
### Opcache
PHP 8.5 made Opcache a required part of PHP, so [PHP 8.5 had to be
compiled with
Opcache](https://github\.com//pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs#r2570572781).
#### Intl
We had to [enable Opcache when compiling Intl to PHP
8.5](https://github\.com//pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs#r2572307438).
Opcache grew in the web Asyncify build size over the 8MB limit for
synchronous WASM compilation on the main thread, so we had to [optimize
the WASM file
size.](https://github\.com//pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs#r2581296925)
#### Xdebug
Similarly to Intl, we had to [enable Opcache when compiling Xdebug to
PHP
8.5.](https://github.com/WordPress/wordpress-playground/pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs#r2572307837)
#### File locking
The behavior or file locking changed in PHP 8.5 because it uses Opcache.
Before PHP 8.5 file locking would use `F_SETLK`, but with Opcache it
uses `F_SETLKW` [when calling
`fcntl`](https://github.com/php/php-src/blob/master/ext/opcache/zend_shared_alloc.c?rgh-link-date=2025-12-02T09%3A41%3A50Z#L510).
Because `F_SETLKW` wasn't implemented in PHP-wasm file locking, this [PR
adds a partial implementation of `F_SETLKW` based on
`F_SETLK`](https://github.com/WordPress/wordpress-playground/pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs&file-filters%5B%5D=.js#r2580401797).
For the feature to be fully implemented, we still need to make it
blocking.
### Deprecated functions
PHP 8.5 deprecated resource free-up functions like `curl_close` and
`imagedestroy`, which aren't needed since PHP 8.0.
This PR removes these function calls from tests, [including CURL PHP 7
tests](https://github.com/WordPress/wordpress-playground/pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs#r2572324571).
`imagedestroy` used to [run only for PHP 8.1+
tests](https://github\.com//pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs/53e6604bccaf721d6367b0dc64ab287fd6a3c8e4#diff-eb57c8ef57583ca8dae1d36a9c6c4533a4529bba4cbd03a2de04df4a3e40bb75),
so it didn't do anything and is safe to remove.
### Object `clone`
PHP 8.5+ changed clone from an opcode to a function, which changes how
asyncify errors are handled during clone operations, which broke one of
our PHP crash tests. In this [PR we disabled the test for PHP
8.5+](https://github.com/WordPress/wordpress-playground/pull/2950/files?file-filters%5B%5D=.json&file-filters%5B%5D=.md&file-filters%5B%5D=No+extension&file-filters%5B%5D=.patch&file-filters%5B%5D=.ts&file-filters%5B%5D=.mjs#r2580468254).
## 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](http://127.0.0.1:9400/phpinfo.php), confirm the php
version it 8.51 parent 0ce8e47 commit 10277ed
File tree
112 files changed
+622269
-499462
lines changed- .vscode
- packages
- docs/site/docs
- blueprints
- developers/06-apis/query-api
- php-wasm
- compile
- php
- xdebug
- node
- asyncify
- 7_2_34
- 7_3_33
- 7_4_33
- 8_0_30
- 8_1_33
- 8_2_29
- 8_3_28
- 8_4_15
- 8_5_0
- extensions
- intl/8_5
- xdebug/8_5
- jspi
- 7_2_34
- 7_3_33
- 7_4_33
- 8_0_30
- 8_1_33
- 8_2_29
- 8_3_28
- 8_4_15
- 8_5_0
- extensions
- intl/8_5
- xdebug/8_5
- src
- lib
- extensions/intl
- xdebug
- test
- universal/src/lib
- web
- public/php
- asyncify
- 7_2_34
- 7_3_33
- 7_4_33
- 8_0_30
- 8_1_33
- 8_2_29
- 8_3_28
- 8_4_15
- 8_5_0
- extensions/intl/8_5
- jspi
- 7_2_34
- 7_3_33
- 7_4_33
- 8_0_30
- 8_1_33
- 8_2_29
- 8_3_28
- 8_4_15
- 8_5_0
- extensions/intl/8_5
- src/lib
- extensions/intl
- playground
- blueprints/public
- website/playwright/e2e
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
112 files changed
+622269
-499462
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
Lines changed: 15 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
365 | 368 | | |
366 | 369 | | |
367 | 370 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
375 | 380 | | |
376 | 381 | | |
377 | 382 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments