Vigyata.AI
Is this your channel?
AmitmerchantAmitmerchant

Amitmerchant Product

This write-up covers the proposed PHP 8.5 array_first and array_last helpers, and I’m fully on board with it. It removes the awkward reset/end pointer side-effects and the verbosity of array_key_first/last + indexing. If it lands, it’s a tiny change that saves time and avoids subtle bugs.

Buy on Amitmerchant

You'll be taken to Amitmerchant to complete your purchase.

Pros

  • +Cleaner way to get first/last array values without pointer side effects
  • +Returns null for empty arrays (predictable behavior)
  • +Works for indexed and associative arrays

Cons

  • -It’s a proposal for PHP 8.5, so timing/availability depends on acceptance

Featured in this video