pattern-directory
pattern-directory copied to clipboard
The code requires PHP 8, so tell wp-env to use it.
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.
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)
Is that code outside of WordPress? Asking because of https://github.com/WordPress/wordpress-develop/blob/d2f420493d87465c323190892d4e7a6e4c6070a7/src/wp-includes/compat.php#L440.