"Deprecated function: implode()" on GMap Drupal module I have containerised a legacy Drupal 7 website with Docker. This is the docker-compose file:
version: '2.0'
services:
    drupal:
        build: .
        ports:
         - &quot;8080:80&quot;
        links:
         - mysql:mysql
    mysql:
        build: ./db
        ports:
         - &quot;6603:3306&quot;

The drupal container uses the official drupal:7.72 image, whereas mysql stems from mysql:5. The database container is responsive and reachable from the Drupal container. The main page of the website loads correctly, but it shows this error message:

Deprecated function: implode(): Passing glue string after array is
deprecated. Swap the parameters in
Drupal\gmap\GmapDefaults-&gt;__construct() (line 107 of
/var/www/html/sites/all/modules/gmap/lib/Drupal/gmap/GmapDefaults.php).

There is a similar error reported for a different function in Drupal 7.70. But apparently it was resolved with 7.71.
How can this particular error be solved? Would editing the GmapDefaults.php file be an option?
This answer draws upon the comments above by leymannx. The essential problem is an incompatibility between the GMap module and PHP 7.4, for which a patch is available. In this answer the patch is applied to the code repository itself, prior to any Docker builds, this is possibly the cleanest method.
The first step is to download the patch into the right folder in the repository:
cd sites/all/modules/gmap
wget https://www.drupal.org/files/issues/2020-03-06/gmap-php7.4.patch

The patch file is encoded for MSDOS, therefore it must be converted before the patch can be applied. Here all the target files are converted too, as a precaution:
dos2unix ./gmap-php7.4.patch
dos2unix gmap_test/gmap_test.features.inc
dos2unix lib/Drupal/gmap/GmapDefaults.php
dos2unix tests/inc/gmap_defaults.inc

The patch can now be applied. Since this is a git repository, the git command itself can not be used.
patch -p1 -i ./gmap-php7.4.patch

Finally remove all the extra files the process may have created. They are not needed in the container.
rm *.patch gmap_test/gmap_test.features.inc.orig lib/Drupal/gmap/GmapDefaults.php.orig tests/inc/gmap_defaults.inc.orig