array_flip

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Exchanges all keys with their associated values in an array
<?php array_flip(array $array): array
<?php     public function flip($value)

    {

        return array_flip($value);

    }
<?php     public function getUserId(string $id): ?string

    {

        return array_flip($this->getIds())[$id] ?? null;

    }



    public function findOrCreateUser($socialite): StatamicUser
<?php     protected function setMessage()

    {

        $this->message = array_flip(array_filter(get_defined_constants(true)['pcre'], function ($value) {

            return substr($value, -6) === '_ERROR';

        }, ARRAY_FILTER_USE_KEY))[$this->error];

    }



    public function getSolution(): Solution
<?php         parent::setUp();



        $uses = array_flip(class_uses_recursive(static::class));



        if (isset($uses[PreventSavingStacheItemsToDisk::class])) {

            $this->preventSavingStacheItemsToDisk();
<?php     public function tearDown(): void

    {

        $uses = array_flip(class_uses_recursive(static::class));



        if (isset($uses[PreventSavingStacheItemsToDisk::class])) {

            $this->deleteFakeStacheDirectory();