2017 © Pedro Peláez
 

library array-fl

Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last().

image

p810/array-fl

Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last().

  • Friday, July 20, 2018
  • by p810
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

array-fl

Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last()., (*1)

Installation

This package is available via Packagist:, (*2)

composer require p810/array-fl

You can also download it directly from GitHub. Latest stable tag: 1.2.0, (*3)

API

array_first(array $array): null|array

Returns a tuple containing the key and value of the first item in $array. If $array is not an array or is empty, null is returned., (*4)

array_last(array $array): null|array

Returns a tuple containing the key and value of the last item in $array. If $array is not an array or is empty, null is returned., (*5)

array_key_first(array $array): null|int|string

Returns the key of the first item in $array. If $array is not an array or is empty, null is returned., (*6)

array_key_last(array $array): null|int|string

Returns the key of the last item in $array. If $array is not an array or is empty, null is returned., (*7)

array_value_first(array $array): null|mixed

Returns the value of the first item in $array. If $array is not an array or is empty, null is returned., (*8)

array_value_last(array $array): null|mixed

Returns the value of the last item in $array. If $array is not an array or is empty, null is returned., (*9)

Tests

Run composer run test to run a set of unit tests for these functions. No external dependency (e.g. PHPUnit) is required., (*10)

The Versions

20/07 2018

dev-master

9999999-dev

Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last().

  Sources   Download

MIT

by Payton Bice

20/07 2018

1.1.1

1.1.1.0

Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last().

  Sources   Download

MIT

by Payton Bice

18/07 2018

1.1.0

1.1.0.0

Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last().

  Sources   Download

MIT

by Payton Bice

18/07 2018

1.0.0

1.0.0.0

Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last().

  Sources   Download

MIT

by Payton Bice