Skip to content
Wade Womersley

wade.one

wade womersley – york based software engineer

  • Home
  • 2026
  • May
  • 31
  • PHP 8.5 array_first and array_last Remove Tiny Annoying Helpers

PHP 8.5 array_first and array_last Remove Tiny Annoying Helpers

Posted on May 31, 2026 By
PHP, Programming

array_first and array_last are not the kind of features that sell a release, but they are exactly the kind I like. They remove tiny helper functions that too many PHP codebases already carry around like loose change in a drawer.

PHP 8.5 adds new array_first and array_last functions. The value is not that getting the first or last item was impossible before. It was always possible. The problem is that the common ways to do it are either a bit noisy, a bit easy to get wrong with keys, or wrapped in local helpers with slightly different names and behaviours.

Small standard-library additions matter because they reduce local vocabulary. If every project has first, first_value, array_first_item, or a collection helper just to do this, readers have to learn one more project-specific convention. A native function gives the boring operation a boring name, which is usually what I want.

This is also a good reminder that language releases do not have to be made only of big ideas. Sometimes the most welcome change is the one that deletes three lines from a utility class and makes the intent obvious. Not every feature needs a parade. Some can just quietly make the code less irritating.

Share:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit

Related

Comments

comments

Tags: arrays php php-8-5 standard-library

Post navigation

❮ Previous Post: PHP 8.5 Deprecations Are a Good Upgrade Checklist
Next Post: I Miss When Gadgets Looked Like They Escaped From a Toy Box ❯

You may also like

News
Link Checker Update – Download Meta Data, Errors, Redirects as CSV
November 5, 2009
Programming
#leedsphp talk slides uploaded
April 22, 2011
News
Link Checker – Free Tool Launched on Site
October 22, 2009
AI
Android Studio Local AI Agents Are the Interesting Bit
May 20, 2026
  • AI
  • artificial intelligence
  • Ego-centric
  • Events
  • Films
  • Food
  • Gaming
  • Gym
  • Hardware
  • Holidays
  • News
  • PHP
  • Programming
  • Random Stuff
  • Reviews
  • Science
  • SEO
  • Software
  • Software Engineer
  • Support
  • Uncategorized
  • Work

Copyright © 2026 wade.one.

Theme: Oceanly News Dark by ScriptsTown