PackageTrack
Sign in Get early access

grasmash/expander

Expands internal property references in PHP arrays.

4.0.0 67M downloads/mo #592 most downloaded on Packagist grasmash/expander

What this package is like to depend on

Last release 2 months ago

11 Jun 2026

Release timing varies

gaps range from 2 weeks to 2.5 years

Some releases are documented

notes for 4 of 8 stable releases

Nothing withdrawn

no release was ever pulled

9 years old

9 releases · first in 2017

1 release in the last 12 months

see the full history below

Release timeline

9 releases · Dec 2017 to Jun 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 9
  1. 4.0.0 11 Jun 2026
    Release notes

    What's new in 4.0

    Major modernization release. Requires PHP 8.2+.

    Bug and security fixes

    • Fixed memory-exhaustion DoS: circular property references with surrounding text (e.g. ['a' => 'x${b}', 'b' => 'y${a}']) previously grew unboundedly until the process crashed. Expansion is now capped at 25 passes / 1 MiB per value.
    • ${env.*} placeholders no longer read HTTP_* keys from $_SERVER — in a web context those originate from client-supplied request headers, not the environment.
    • Falsy environment variables now expand: VAR=0 previously failed a truthiness check and left the placeholder unexpanded.
    • Type preservation in reference-data mode: booleans, integers, and floats expanded via a reference array previously coerced to strings (true became "1"). Types are now preserved.
    • Single-placeholder strings are expanded once instead of twice, eliminating duplicate logger and stringifier side effects.
    • A PCRE failure during replacement now restores the original value instead of nulling it.

    Breaking changes

    • PHP 8.2+ is required.
    • All source files declare strict_types=1, with full parameter and return type declarations.
    • StringifierInterface::stringifyArray() is now an instance method rather than a static method. Custom implementations and static callers must update.
    • Expander::expandArrayProperties() requires $reference_array to be an array.
    • Expander::expandPropertyWithReferenceData() returns mixed instead of ?string.

    Tooling

    • PHPUnit ^10.5 || ^11 || ^12 || ^13, phpstan level 5, PHP_CodeSniffer ^3.13 || ^4.0.
    • CI matrix covers PHP 8.2, 8.3, 8.4, and 8.5, with a composer audit step.
    • 100% line, method, and class test coverage.
    • Dependabot keeps composer and GitHub Actions dependencies current.

    Full changelog: 3.0.1...4.0.0

    Open source →
  2. 3.0.1 25 Nov 2024
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 3.0.0...3.0.1

    Open source →
  3. 3.0.0 10 May 2022
    Release notes

    What's Changed

    • GitHub Actions by @grasmash in #18
    • Expand support for env vars by using both $_SERVER and getenv().

    Full Changelog: 2.0.3...3.0.0

    Open source →
  4. 2.0.3 25 Apr 2022

    Nothing published for this version

  5. 2.0.2 24 Feb 2022

    Nothing published for this version

  6. 2.0.1 19 Feb 2022
    Release notes

    What's Changed

    Full Changelog: 2.0.0...2.0.1

    Open source →
  7. 2.0.0 08 Dec 2021

    Nothing published for this version

  8. 2.0.0-beta1 17 Aug 2019 pre-release
    Release notes
    • Removed support for PHP 5.4 and 5.5
    • Added dependency on psr/log.
    Open source →
  9. 1.0.0 21 Dec 2017

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive