PHPackages                             grasmash/expander - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. grasmash/expander

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

grasmash/expander
=================

Expands internal property references in PHP arrays file.

3.0.1(1y ago)13960.7M—2.6%10[2 issues](https://github.com/grasmash/expander/issues)6MITPHPPHP &gt;=8.0CI failing

Since Dec 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/grasmash/expander)[ Packagist](https://packagist.org/packages/grasmash/expander)[ RSS](/packages/grasmash-expander/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (15)Used By (6)

[![CI](https://github.com/grasmash/expander/actions/workflows/php.yml/badge.svg)](https://github.com/grasmash/expander/actions/workflows/php.yml) [![Packagist](https://camo.githubusercontent.com/7e553b81929c02612ed46e686aaf1ca9463b4afa348cfb4d899bce95a9215acd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677261736d6173682f657870616e6465722e737667)](https://packagist.org/packages/grasmash/expander)[![Total Downloads](https://camo.githubusercontent.com/f4df731d88cb6b6e951b967227495e8bcbcb5d441c83d240a8e15701ac1c24b2/68747470733a2f2f706f7365722e707567782e6f72672f677261736d6173682f657870616e6465722f646f776e6c6f616473)](https://packagist.org/packages/grasmash/expander) [![Coverage Status](https://camo.githubusercontent.com/36ded205d36efa4d9eb32964406969c1d4477d62398fb2bbf2eaeb5ef045412c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f677261736d6173682f657870616e6465722f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/grasmash/expander?branch=main)

This tool expands dot-notated, string property references into their corresponding values. This is useful for run time expansion of property references in configuration files.

For example implementation, see [Yaml Expander](https://github.com/grasmash/yaml-expander).

### Installation

[](#installation)

```
composer require grasmash/expander

```

### Example usage:

[](#example-usage)

Property references use dot notation to indicate array keys, and must be wrapped in `${}`.

Expansion logic:

```
