Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Fetch a key from an array
key(array|object $array): int|string|null
        foreach ($this->items as $key => $item) {

            
$pair $callback($item$key);



            
$key key($pair);



            
$value reset($pair);
                return;

            }



            
$index key($matches);

        } else {

            
$index array_search($this->components->choice('Which command would you like to run?'$commandNames), $commandNames);

        }
    {

        
$relation array_shift($path);



        
$name explode(':'key($relation))[0];



        if (
is_string(reset($relation))) {

            
$relation reset($relation);
            );

        }



        return 
app('cache')->put(key($arguments[0]), reset($arguments[0]), $arguments[1] ?? null);

    }

}
        $extensions $factory->getExtensions();

        
$this->assertSame('bar'reset($extensions));

        
$this->assertSame('foo'key($extensions));

    }



    public function 
testPrependedExtensionOverridesExistingExtensions()
        $extensions $factory->getExtensions();

        
$this->assertSame('bar'reset($extensions));

        
$this->assertSame('baz'key($extensions));

    }



    public function 
testComposersAreProperlyRegistered()