Skip to content

Conversation

@tellyworth
Copy link
Contributor

The codebase includes a couple of calls to str_contains(), which is PHP 8.0+ only. It's possible to get a fatal error when running the local environment on 7.4, but that will be the default for some users.

This one-liner tells wp-env to use PHP 8.0.

@dd32
Copy link
Member

dd32 commented Nov 21, 2022

WordPress contains a compat version of the str_* functions for older PHP releases.

Any reason this shouldn't be bumped to PHP 8.1 though? (The next version we'll use on WordPress.org)

@ocean90
Copy link
Member

ocean90 commented Nov 21, 2022

@dd32
Copy link
Member

dd32 commented Dec 9, 2025

Might as well bump it to PHP 8.1 to match production. (I don't think the fatal described in the OP is possible, but this is for unrelated reasons)

@dd32 dd32 merged commit 8d542b4 into trunk Dec 10, 2025
3 checks passed
@dd32 dd32 deleted the fix/wp-env-php-8 branch December 10, 2025 00:51
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.

4 participants