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
PHP 7.4 syntax issues causing warning messages.
Steps to reproduce
phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4
Proposed resolution
Use PHP 7.4 compatible syntax where possible without breaking backwards compatibility.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3203849-php-7.4-compatibility.patch | 1.71 KB | mvc |
Comments
Comment #2
mvcThe curly brace array syntax causes noisy messages in error logs; the other two issues are false reports and are fixed here so that anyone running a PHP 7.4 compatibility check won't see a message and have to take time to investigate.
Comment #3
alexpott@mvc I'd remove the two other changes - they're not necessary for the fix. We can add automated testing to check for PHP 7.4 compatibility.
Comment #4
Gábor HojtsyGiven that this is in "vendor" libraries (that we inline for the sake of ease of use), can we see about updating them instead? I assume they worked this out :) This would not apply to the Drupal 8/9 version since those should have the vendor libraries available from core.
Comment #5
mvc@Gábor Hojtsy yes, those issues were fixed upstream, but the copies here are ancient and updating them would be a huge change, which would have required a lot more time & test coverage.
I can re-roll to just include the curly brace issue if you want but then the code will still look wrong to anyone running a PHP compatibility check, in an automated test or otherwise.