Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Merge one or more arrays
<?php array_merge(array ...$arrays): array
<?php         foreach ($packageMap as $item) {

            $package = $item[0];

            foreach (array_merge($package->getReplaces(), $package->getProvides()) as $link) {

                if (Preg::isMatch('{^ext-(.+)$}iD', $link->getTarget(), $match)) {

                    $extensionProviders[$match[1]][] = $link->getConstraint();

                }
<?php     public function addClassMap(array $classMap)

    {

        if ($this->classMap) {

            $this->classMap = array_merge($this->classMap, $classMap);

        } else {

            $this->classMap = $classMap;

        }
<?php     {

        if (!$prefix) {

            if ($prepend) {

                $this->fallbackDirsPsr0 = array_merge(

                    (array) $paths,

                    $this->fallbackDirsPsr0

                );

            } else {

                $this->fallbackDirsPsr0 = array_merge(

                    $this->fallbackDirsPsr0,
<?php                     $this->fallbackDirsPsr0

                );

            } else {

                $this->fallbackDirsPsr0 = array_merge(

                    $this->fallbackDirsPsr0,

                    (array) $paths

                );

            }



            return;
<?php             return;

        }

        if ($prepend) {

            $this->prefixesPsr0[$first][$prefix] = array_merge(

                (array) $paths,

                $this->prefixesPsr0[$first][$prefix]

            );

        } else {

            $this->prefixesPsr0[$first][$prefix] = array_merge(

                $this->prefixesPsr0[$first][$prefix],
<?php                 $this->prefixesPsr0[$first][$prefix]

            );

        } else {

            $this->prefixesPsr0[$first][$prefix] = array_merge(

                $this->prefixesPsr0[$first][$prefix],

                (array) $paths

            );

        }

    }
<?php         if (!$prefix) {


            if ($prepend) {

                $this->fallbackDirsPsr4 = array_merge(

                    (array) $paths,

                    $this->fallbackDirsPsr4

                );

            } else {

                $this->fallbackDirsPsr4 = array_merge(

                    $this->fallbackDirsPsr4,
<?php                     $this->fallbackDirsPsr4

                );

            } else {

                $this->fallbackDirsPsr4 = array_merge(

                    $this->fallbackDirsPsr4,

                    (array) $paths

                );

            }

        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
<?php             $this->prefixDirsPsr4[$prefix] = (array) $paths;

        } elseif ($prepend) {


            $this->prefixDirsPsr4[$prefix] = array_merge(

                (array) $paths,

                $this->prefixDirsPsr4[$prefix]

            );

        } else {


            $this->prefixDirsPsr4[$prefix] = array_merge(
<?php             );

        } else {


            $this->prefixDirsPsr4[$prefix] = array_merge(

                $this->prefixDirsPsr4[$prefix],

                (array) $paths

            );

        }

    }
<?php         $maps = array();



        foreach ($dirs as $dir) {

            $maps = array_merge($maps, static::createMap($dir));

        }



        file_put_contents($file, sprintf('<?php return %s;', var_export($maps, true)));
<?php                 $extraTypes .= '|enum';

            }



            PhpFileCleaner::setTypeConfig(array_merge(['class', 'interface', 'trait'], array_filter(explode('|', $extraTypes))));

        }



        return $extraTypes;
<?php         if ($composer = $this->getComposer(false)) {

            $localRepo = $composer->getRepositoryManager()->getLocalRepository();

            $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)));
<?php         $needles = array($needle);

        if ($inverted) {

            foreach ($packages as $package) {

                $needles = array_merge($needles, array_map(function (Link $link) {

                    return $link->getTarget();

                }, $package->getReplaces()));

            }

        }
<?php                 $version = $package->getPrettyVersion() === RootPackage::DEFAULT_PRETTY_VERSION ? '-' : $package->getPrettyVersion();

                $rows[] = array($package->getPrettyName(), $version, $link->getDescription(), sprintf('%s (%s)', $link->getTarget(), $link->getPrettyConstraint()));

                if ($children) {

                    $queue = array_merge($queue, $children);

                }

            }

            $results = $queue;