There are multiple places where historical order of parameters is being used when calling implode()
PHP7.4:
Passing parameters to implode() in reverse order is deprecated, use implode($glue, $parts) instead of implode($parts, $glue).
See https://www.php.net/manual/en/migration74.deprecated.php#migration74.dep...
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | interdiff.3084943.2-13.txt | 1.16 KB | longwave |
| #13 | 3084943-13.patch | 965 bytes | longwave |
Comments
Comment #2
taran2lPatch attached
Comment #3
avpadernoComment #4
avpadernoThis is quite simple:
implode($glue, $parts)is not going to cause issues with any supported PHP version.Comment #5
joseph.olstadTriage.
First priority before this:
To increase our confidence in the test results for the above php 7.4 compatibility issue, these two others should go in first so we can re-queue php 7.3 and php 5.3 tests.
#3047844: [Regression] Tests fail on PHP 5.3
#3025335: session_id() cannot be changed after session is started
Comment #6
mustanggb commentedComment #7
mustanggb commentedComment #8
liam morlandComment #9
andypost8.x fixed
Comment #10
izmeez commentedRe-queued testing with php 7.4 as per comment #5 with reference issues now closed.
Comment #11
izmeez commentedWhen patch in comment #2 is applied it resolves the deprecated implode function with php 7.4 but exposes warnings as described in #3084953: Trying to access array offset on value of type null in _drupal_build_css_path() where there is a working patch.
Comment #12
mcdruid commentedLooking at the docs for
implode()it seems it's not necessary to add an empty$glueparameter.Looking at D8 after #3104421: PHP 7.4 deprecated reverse order of glue and pieces in implode, there are still examples of calls with just the
$piecesparam such as:[edit: removed some examples which were not PHP's native
implode()function]So I think we can remove the last few changes in the patch where there's only one param.
Comment #13
longwaveComment #14
taran2lI was also thinking about skipping the second param but decided to keep it. However, let's be consistent with D8
Comment #15
mcdruid commentedGreat, thank you!
I've not been able to find any other calls with the params the wrong way around in D7 core.
This LGTM for commit; ready for final review.
Comment #16
fabianx commentedRTBM - Ready to be merged, let's get this in.
Comment #18
mcdruid commentedThanks everybody!