Problem/Motivation
After upgrading from PHP 7.4 to 8.0 locally the following error started showing when launch the simpletest runner:
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in scripts/run-tests.sh on line 331
The error happens because $_SERVER['SERVER_SOFTWARE'] is NULL when the script starts.
Steps to reproduce
Start scripts/run-tests.sh with PHP 8.0.
Proposed resolution
Fix the bug.
Remaining tasks
Fix the bug.
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Release notes snippet
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | drupal-n3276848-2.patch | 752 bytes | damienmckenna |
Comments
Comment #2
damienmckennaIdentified the problem being caused by $_SERVER['SERVER_SOFTWARE'] not having a value when the script runs. So that's an easy fix.
Comment #3
damienmckennaComment #4
poker10 commentedI have added it to the list of compatibility issues with PHP 8.1.
Comment #5
joseph.olstadlooks like a good fix, thanks @DamienMcKenna and @poker10 and @mcdruid
Comment #6
steinmb commentedComment #7
mcdruid commentedI'd perhaps make the comment less specific as different environments may have different empty elements in the $_SERVER array, but it's fine as it is.
I think this is ready for commit. Thanks!
Comment #9
poker10 commentedThanks all!