Skip to content

v4.0.0

Latest

Choose a tag to compare

@estefanionsantos estefanionsantos released this 29 Jun 00:05

Major structural release upgrading the core array engine to target PHP 8.2+. This version introduces a robust, modern API, native strict typing enforcement, and an expanded suite of powerful utility features for matrix manipulation.

What's Changed

Architecture & PHP 8.2 Enhancements

  • Strict Types Enforcement: Integrated declare(strict_types=1); natively across all interfaces and the concrete StemArr implementation.
  • Modern Engine Compliance: Cleaned up internal syntax and formatting to strictly comply with PSR-12/PER standards.
  • Upgraded package requirements to lock minimum environment compatibility to PHP ^8.2.

New Utility Features (Expanded API)

  • Validation Drivers:
    • isMulti: Detects multidimensional arrays using fast short-circuit evaluations.
    • isAssoc: Validates associative structures leveraging the native array_is_list negation layer.
  • Advanced Sorting: Dedicated sort and sortDesc methods ensuring immutable data treatment while preserving key-value association indices via asort/arsort.
  • Element Extraction: Added random to safely extract single elements or custom length slices without overflow errors.
  • Payload Filtering: Introduced only (whitelist filtering) and except (blacklist removal) for fast data sanitization.
  • Matrix Flattening: Added flatten to collapse complex nested arrays into a single, linear one-dimensional array.