Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Running run-tests.sh under PHP 8.1 yields many errors like this:
PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/core/scripts/run-tests.sh on line 548
Steps to reproduce
Spin up a PHP 8.1 environment and run run-tests.sh. Forgot how? Here's how.
See the deprecation errors.
Proposed resolution
Fix the things in the deprecation errors.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3316971
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
Mile23Puts some checking around a usage of str_replace().
Comment #4
Mile23Comment #5
andypostused to run tests on PHP 8.2 and I see that
SERVER_SOFTWARE
key isNULL
for meComment #6
Mile23Comment #8
catchCommitted/pushed to 10.1.x and cherry-picked back through to 9.5.x, thanks!