Skip to content

Commit dda41d5

Browse files
authored
Make PHP 8.3 the default version (#2371)
## Motivation for the change, related issues Makes PHP 8.3 the default version used by playground.wordpress.net and Playground CLI. ## Implementation details WordPress reports this warning on PHP 8.0: <img width="720" height="323" alt="screenshot_2025-07-15_at_11 02 26_720" src="https://github.com/user-attachments/assets/ce2ca5c8-0220-4e37-8911-2beefe542b22" /> Furthermore, [PHP 8.3 was the most popular release in January 2025](https://stitcher.io/blog/php-version-stats-january-2025) so there's no real reason not to make it the default. ## Testing Instructions (or ideally a Blueprint) CI
1 parent 62b0990 commit dda41d5

File tree

11 files changed

+28
-16
lines changed

11 files changed

+28
-16
lines changed

packages/playground/blueprints/src/lib/steps/run-php.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { runPHP } from './run-php';
33
import { loadNodeRuntime } from '@php-wasm/node';
44
import { logger } from '@php-wasm/logger';
55
import { vi } from 'vitest';
6+
import { RecommendedPHPVersion } from '@wp-playground/common';
67

7-
const phpVersion = '8.0';
8+
const phpVersion = RecommendedPHPVersion;
89
describe('Blueprint step runPHP', () => {
910
let php: PHP;
1011
let loggerErrorSpy: any;

packages/playground/blueprints/src/lib/steps/run-sql.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { phpVars } from '@php-wasm/util';
33
import { runSql } from './run-sql';
44
import { PHPRequestHandler } from '@php-wasm/universal';
55
import { loadNodeRuntime } from '@php-wasm/node';
6+
import { RecommendedPHPVersion } from '@wp-playground/common';
67

7-
const phpVersion = '8.0';
8+
const phpVersion = RecommendedPHPVersion;
89
describe('Blueprint step runSql', () => {
910
let php: PHP;
1011
let handler: PHPRequestHandler;

packages/playground/blueprints/src/lib/steps/wp-cli.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import {
88
} from '@wp-playground/wordpress-builds';
99
import { bootWordPress } from '@wp-playground/wordpress';
1010
import { loadNodeRuntime } from '@php-wasm/node';
11+
import { RecommendedPHPVersion } from '@wp-playground/common';
1112

12-
const phpVersion = '8.0';
13+
const phpVersion = RecommendedPHPVersion;
1314
describe('Blueprint step wpCLI', () => {
1415
let php: PHP;
1516

packages/playground/blueprints/src/lib/steps/write-files.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { PHP } from '@php-wasm/universal';
22
import { writeFiles } from './write-files';
33
import { PHPRequestHandler } from '@php-wasm/universal';
44
import { loadNodeRuntime } from '@php-wasm/node';
5+
import { RecommendedPHPVersion } from '@wp-playground/common';
56

6-
const phpVersion = '8.0';
7+
const phpVersion = RecommendedPHPVersion;
78
describe('writeFiles', () => {
89
let php: PHP;
910
let handler: PHPRequestHandler;

packages/playground/cli/src/worker-thread.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
sandboxedSpawnHandlerFactory,
1111
} from '@php-wasm/universal';
1212
import { sprintf } from '@php-wasm/util';
13+
import { RecommendedPHPVersion } from '@wp-playground/common';
1314
import { bootWordPress } from '@wp-playground/wordpress';
1415
import { rootCertificates } from 'tls';
1516
import { jspi } from 'wasm-feature-detect';
@@ -111,7 +112,7 @@ export class PlaygroundCliWorker extends PHPWorker {
111112
absoluteUrl,
112113
mountsBeforeWpInstall,
113114
mountsAfterWpInstall,
114-
phpVersion = '8.0',
115+
phpVersion = RecommendedPHPVersion,
115116
wordPressZip,
116117
sqliteIntegrationPluginZip,
117118
firstProcessId,

packages/playground/common/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { phpVars } from '@php-wasm/util';
1414

1515
export { createMemoizedFetch } from './create-memoized-fetch';
1616

17-
export const RecommendedPHPVersion = '8.0';
17+
export const RecommendedPHPVersion = '8.3';
1818

1919
/**
2020
* Unzip a zip file inside Playground.

packages/playground/remote/src/lib/worker-thread.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ import {
2828
hasCachedStaticFilesRemovedFromMinifiedBuild,
2929
} from './worker-utils';
3030
import { EmscriptenDownloadMonitor } from '@php-wasm/progress';
31-
import { createMemoizedFetch } from '@wp-playground/common';
31+
import {
32+
createMemoizedFetch,
33+
RecommendedPHPVersion,
34+
} from '@wp-playground/common';
3235
import type { FilesystemOperation } from '@php-wasm/fs-journal';
3336
import { journalFSEvents, replayFSJournal } from '@php-wasm/fs-journal';
3437
/* @ts-ignore */
@@ -175,7 +178,7 @@ export class PlaygroundWorkerEndpoint extends PHPWorker {
175178
mounts = [],
176179
wpVersion = LatestMinifiedWordPressVersion,
177180
sqliteDriverVersion = LatestSqliteDriverVersion,
178-
phpVersion = '8.0',
181+
phpVersion = RecommendedPHPVersion,
179182
sapiName = 'cli',
180183
withICU = false,
181184
withNetworking = true,

packages/playground/website/cypress/e2e/query-api.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const LatestSupportedWordPressVersion = Object.keys(
1010

1111
describe('Query API', () => {
1212
describe('option `php`', () => {
13-
it('should load PHP 8.0 by default', () => {
13+
it('should load PHP 8.3 by default', () => {
1414
cy.visit('/?url=/phpinfo.php');
1515
cy.wordPressDocument()
1616
.find('h1')
17-
.should('contain', 'PHP Version 8.0');
17+
.should('contain', 'PHP Version 8.3');
1818
});
1919

2020
it('should load PHP 7.4 when requested', () => {

packages/playground/website/playwright/e2e/query-api.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const LatestSupportedWordPressVersion = Object.keys(
1010
MinifiedWordPressVersions
1111
).filter((x) => !['nightly', 'beta'].includes(x))[0];
1212

13-
test('should load PHP 8.0 by default', async ({ website, wordpress }) => {
13+
test('should load PHP 8.3 by default', async ({ website, wordpress }) => {
1414
// Navigate to the website
1515
await website.goto('./?url=/phpinfo.php');
1616
await expect(wordpress.locator('h1.p').first()).toContainText(
17-
'PHP Version 8.0'
17+
'PHP Version 8.3'
1818
);
1919
});
2020

@@ -127,8 +127,8 @@ test('should retain encoded control characters in the URL', async ({
127127
test.skip(
128128
browserName === 'firefox' || browserName === 'webkit',
129129
`It's unclear why this test fails in Firefox and Safari. The actual feature seems to be working in manual testing. ` +
130-
`Let's figure this out and re-enable the test at one point. The upsides of merging the original PR sill ` +
131-
`outweighted the downsides of disabling the test on FF.`
130+
`Let's figure this out and re-enable the test at one point. The upsides of merging the original PR sill ` +
131+
`outweighted the downsides of disabling the test on FF.`
132132
);
133133
const path =
134134
'/wp-admin/admin.php?page=html-api-debugger&html=%3Cdiv%3E%0A1%0A2%0A3%0A%3C%2Fdiv%3E';

packages/playground/website/src/components/site-manager/site-settings-form/unconnected-site-settings-form.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Controller, useForm } from 'react-hook-form';
77
import classNames from 'classnames';
88
import { __experimentalVStack as VStack } from '@wordpress/components';
99
import { useSupportedWordPressVersions } from './use-supported-wordpress-versions';
10+
import { RecommendedPHPVersion } from '@wp-playground/common';
1011

1112
type ConfigurableFields = Record<
1213
keyof SiteFormData & ('wpVersion' | 'language' | 'multisite'),
@@ -43,7 +44,7 @@ export function UnconnectedSiteSettingsForm({
4344
},
4445
}: SiteSettingsFormProps) {
4546
defaultValues = {
46-
phpVersion: '8.0',
47+
phpVersion: RecommendedPHPVersion,
4748
wpVersion: 'latest',
4849
language: '',
4950
withNetworking: true,

0 commit comments

Comments
 (0)