Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Join array elements with a string
Alias join
<?php implode(string $separator, array $array): string
<?php             }

            $exportedPrefix = var_export($namespace, true);

            $namespacesFile .= "    $exportedPrefix => ";

            $namespacesFile .= "array(".implode(', ', $exportedPaths)."),\n";

        }

        $namespacesFile .= ");\n";
<?php             }

            $exportedPrefix = var_export($namespace, true);

            $psr4File .= "    $exportedPrefix => ";

            $psr4File .= "array(".implode(', ', $exportedPaths)."),\n";

        }

        $psr4File .= ");\n";
<?php         $mainAutoload = $rootPackage->getAutoload();

        if ($rootPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {

            $levels = substr_count($filesystem->normalizePath($rootPackage->getTargetDir()), '/') + 1;

            $prefixes = implode(', ', array_map(function ($prefix) {

                return var_export($prefix, true);

            }, array_keys($mainAutoload['psr-0'])));

            $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);



            $targetDirLoader = <<<EOF
<?php             $this->io->writeError(

                '<warning>Warning: Ambiguous class resolution, "'.$className.'"'.

                ' was found '. (count($ambiguousPaths) + 1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambiguousPaths) .'", the first will be used.</warning>'

            );

        }
<?php                 }

            }



            $excluded = $excluded ? '{(' . implode('|', $excluded) . ')}' : null;

        }



        return ClassMapGenerator::createMap($dir, $excluded, $showAmbiguousWarning ? $this->io : null, $namespaceFilter, $autoloadType, $scannedFiles);
<?php             $chunks = explode('.', $version);

            $chunks = array_slice($chunks, 0, 3);



            return implode('.', $chunks);

        };



        $requiredPhp = '';
<?php PHP_CHECK;

        }



        $requiredExtensions = implode('', $requiredExtensions);

        if ('' !== $requiredExtensions) {

            $requiredExtensions = <<<EXT_CHECKS
<?php             );

        }



        self::$restPattern = '{[^?"\'</'.implode('', array_keys(self::$typeConfig)).']+}A';

    }
<?php             $repo = new CompositeRepository(array_merge(array($localRepo), $composer->getRepositoryManager()->getRepositories()));

        } else {

            $defaultRepos = RepositoryFactory::defaultRepos($this->getIO());

            $io->writeError('No composer.json found in the current directory, searching packages from ' . implode(', ', array_keys($defaultRepos)));

            $repo = new CompositeRepository($defaultRepos);

        }
<?php         if (count($packages) > 1) {

            $package = reset($packages);

            $io->writeError('<info>Found multiple matches, selected '.$package->getPrettyString().'.</info>');

            $io->writeError('Alternatives were '.implode(', ', array_map(function ($p) {

                return $p->getPrettyString();

            }, $packages)).'.');

            $io->writeError('<comment>Please use a more specific constraint to pick a different package.</comment>');

        } elseif ($packages) {

            $package = reset($packages);
<?php                 return 0;

            }



            $this->configSource->addProperty($settingKey, implode(' ', $values));



            return 0;

        }
<?php                     return is_array($val) ? json_encode($val) : $val;

                }, $value);



                $value = '['.implode(', ', $value).']';

            }



            if (is_bool($value)) {
<?php         if (null === $stability) {

            if (null === $packageVersion) {

                $stability = 'stable';

            } elseif (Preg::isMatch('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) {

                $stability = $match[1];

            } else {

                $stability = VersionParser::parseStability($packageVersion);
<?php         $stability = VersionParser::normalizeStability($stability);



        if (!isset(BasePackage::$stabilities[$stability])) {

            throw new \InvalidArgumentException('Invalid stability provided ('.$stability.'), must be one of: '.implode(', ', array_keys(BasePackage::$stabilities)));

        }



        $composer = Factory::create($io, $config->all(), $disablePlugins);
<?php                 $io->write('');

                $io->write(sprintf("<comment>%s</comment>", $vendor));

                foreach ($links as $url => $packages) {

                    $line = sprintf('  <info>%s</info>', implode(', ', $packages));



                    if ($prev !== $line) {

                        $io->write($line);