Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Set the internal pointer of an array to its first element
<?php reset(array|object &$array): mixed
<?php     protected function getMimetypeFromResponse($path, ResponseInterface $response)

    {

        if ($mimetype = $response->getHeader('Content-Type')) {

            [$mimetype] = explode(';', reset($mimetype), 2);



            return trim($mimetype);

        }
<?php         ];



        if ($last_modified = $response->getHeader('Last-Modified')) {

            $last_modified = strtotime(reset($last_modified));



            if ($last_modified !== false) {

                $metadata['timestamp'] = $last_modified;
<?php         }



        if ($length = $response->getHeader('Content-Length')) {

            $length = reset($length);



            if (is_numeric($length)) {

                $metadata['size'] = (int) $length;
<?php             }



            $keyValuePair = $callback();

            $value = reset($keyValuePair);

            $expiration = Carbon::now()->addMinutes(key($keyValuePair));



            return Cache::remember($cacheKey, $expiration, function () use ($value) {
<?php     private function setHaystack(array $data)

    {

        reset($data);

        $firstKey = array_keys($data)[0];

        reset($data);
<?php     {

        reset($data);

        $firstKey = array_keys($data)[0];

        reset($data);



        if (! is_numeric($firstKey)) {

            $this->is_haystack_categorized = true;