PHPackages                             pavlyuts/php-string-key-arrays - 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. pavlyuts/php-string-key-arrays

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

pavlyuts/php-string-key-arrays
==============================

Array-like class with only strings used as keys

0.3(3y ago)0371GPL-2.0-or-laterPHP

Since Jan 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/pavlyuts/php-string-key-arrays)[ Packagist](https://packagist.org/packages/pavlyuts/php-string-key-arrays)[ RSS](/packages/pavlyuts-php-string-key-arrays/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (1)Versions (4)Used By (1)

Array-like class with only strings used as keys
===============================================

[](#array-like-class-with-only-strings-used-as-keys)

Purpose
-------

[](#purpose)

PHP arrays may be veery frustrating with it's mess in key string/integer and associated probems.

It was need to ensure the keys will work predictable as string, but the class still be used as a regular array with `$a['key']` syntax, `foreach` use and all other staff. So, this what it do!

Installation
------------

[](#installation)

In the Composer storage. Just add proper require section:

```
"require": {
    "pavlyuts/php-string-key-arrays": "*"
}

```

I do not think there be a version compatibility problem as it is too simple thing and expected to be stable. However, I recommend to inspect [CHANGELOG.md](https://github.com/pavlyuts/php-string-key-arrays/blob/main/CHANGELOG.md) for changes.

Use
---

[](#use)

### Basics

[](#basics)

Basic use about the same as array but **with some limitations described below**.

Some [useful functions](#useful-functions) also available in the section below

Examples

```
