{"id":24402290,"url":"https://github.com/p810/array-fl","last_synced_at":"2026-04-20T16:31:29.758Z","repository":{"id":57034863,"uuid":"141343983","full_name":"p810/array-fl","owner":"p810","description":"Provides a consolidated polyfill for array_key_first(), array_key_last(), and the unapproved functions array_value_first() and array_value_last().","archived":false,"fork":false,"pushed_at":"2019-04-10T18:35:01.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T04:10:01.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p810.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-17T21:10:23.000Z","updated_at":"2022-01-05T07:38:06.000Z","dependencies_parsed_at":"2022-08-23T20:50:57.846Z","dependency_job_id":null,"html_url":"https://github.com/p810/array-fl","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/p810/array-fl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p810%2Farray-fl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p810%2Farray-fl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p810%2Farray-fl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p810%2Farray-fl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p810","download_url":"https://codeload.github.com/p810/array-fl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p810%2Farray-fl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28101486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-28T02:00:05.685Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-20T00:59:52.950Z","updated_at":"2025-12-28T16:44:38.342Z","avatar_url":"https://github.com/p810.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# array-fl\n\n\u003e Provides a consolidated polyfill for `array_key_first()`, `array_key_last()`, and the unapproved functions `array_value_first()` and `array_value_last()`.\n\n## Installation\n\nThis package is available via Packagist:\n\n```\ncomposer require p810/array-fl\n```\n\nYou can also download it directly from GitHub.\nLatest stable tag: [1.2.0](https://github.com/p810/array-fl/archive/1.2.0.zip)\n\n## API\n\n#### `array_first(array $array): null|array`\nReturns a tuple containing the key and value of the first item in `$array`.\nIf `$array` is not an array or is empty, `null` is returned.\n\n#### `array_last(array $array): null|array`\nReturns a tuple containing the key and value of the last item in `$array`.\nIf `$array` is not an array or is empty, `null` is returned.\n\n#### `array_key_first(array $array): null|int|string`\nReturns the key of the first item in `$array`.\nIf `$array` is not an array or is empty, `null` is returned.\n\n#### `array_key_last(array $array): null|int|string`\nReturns the key of the last item in `$array`.\nIf `$array` is not an array or is empty, `null` is returned.\n\n#### `array_value_first(array $array): null|mixed`\nReturns the value of the first item in `$array`.\nIf `$array` is not an array or is empty, `null` is returned.\n\n#### `array_value_last(array $array): null|mixed`\nReturns the value of the last item in `$array`.\nIf `$array` is not an array or is empty, `null` is returned.\n\n## Tests\n\nRun `composer run test` to run a set of unit tests for these functions.\nNo external dependency (e.g. PHPUnit) is required.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp810%2Farray-fl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp810%2Farray-fl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp810%2Farray-fl/lists"}