← All docs

array_flip()

Exchanges keys and values. Declared PHP arrays use runtime value tags, warn and skip values other than integers or strings, and keep the last key for duplicate values. Concrete AOT storage remains restricted to integer or string elements.

array_flip()

function array_flip(array $array): array

Exchanges keys and values. Declared PHP arrays use runtime value tags, warn and skip values other than integers or strings, and keep the last key for duplicate values. Concrete AOT storage remains restricted to integer or string elements.

Parameters:

  • $array (array)

Returns: array

Availability

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how array_flip is implemented in the compiler, see the internals page.