heterogeny / heterogeny-php
Installs: 3 292
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 2
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: ^7.0
- symfony/var-dumper: ^4.0
This package is auto-updated.
Last update: 2025-03-28 13:45:00 UTC
README
Experimental
Heterogenize PHP's data structures, like array
that is split into Seq
, Dict
and Tuple
.
-
Seq
is a no-keyarray
, setting keys that is not an integer will result in anException
, everySeq
will be JSON encoded as[]
; -
Dict
is a keyedarray
, whether key is string or not, everyDict
will be JSON encoded as{}
; -
Tuple
is just like aSeq
, maybe in the future helpers will be added toTuple
.
Also supplying some helpers for JSON encoding/decoding without headaches on checking whether
something is array
or array
with keys.
Performance is not guaranteed at this point.