Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Fetch a key from an array
<?php key(array|object $array): int|string|null
<?php             $rawVal = isset($rawContents[$key]) ? $rawContents[$key] : null;



            if (is_array($value) && (!is_numeric(key($value)) || ($key === 'repositories' && null === $k))) {

                $k .= Preg::replace('{^config\.}', '', $key . '.');

                $this->listConfiguration($value, $rawVal, $output, $k, $showSource);

                $k = $origK;
<?php             $json = $this->httpDownloader->get($protocol . '://repo.packagist.org/packages.json')->decodeJson();

            $hash = reset($json['provider-includes']);

            $hash = $hash['sha256'];

            $path = str_replace('%hash%', $hash, key($json['provider-includes']));

            $provider = $this->httpDownloader->get($protocol . '://repo.packagist.org/'.$path)->getBody();



            if (hash('sha256', $provider) !== $hash) {
<?php                 if (is_array($repository) && 1 === count($repository) && false === current($repository)) {

                    $this->disableRepoByName((string) key($repository));

                    continue;

                }
<?php     public function key(): ?int

    {

        return key($this->decisionQueue);

    }



    public function next(): void
<?php         $download = function () use ($io, $output, $httpDownloader, $cache, $cacheKeyGenerator, $eventDispatcher, $package, $fileName, &$urls, &$accept, &$reject) {


            $url = reset($urls);

            $index = key($urls);



            if ($eventDispatcher) {

                $preFileDownloadEvent = new PreFileDownloadEvent(PluginEvents::PRE_FILE_DOWNLOAD, $httpDownloader, $url['processed'], 'package', $package);
<?php         if (is_array($data)) {

            reset($data);



            if (is_numeric(key($data))) {

                foreach ($data as $key => $val) {

                    $data[$key] = $this->format($val, $depth + 1);

                }
<?php         $this->config = $config['package'];




        if (!is_numeric(key($this->config))) {

            $this->config = array($this->config);

        }

    }
<?php             }

        }



        $composerJsonPath = key($topLevelPaths).'/composer.json';

        if ($topLevelPaths && isset($phar[$composerJsonPath])) {

            return $phar[$composerJsonPath]->getContent();

        }
<?php             }

        }



        if ($topLevelPaths && false !== ($index = $zip->locateName(key($topLevelPaths).$filename)) && $zip->getFromIndex($index) !== false) {

            return $index;

        }