PHPackages                             mvanvu/php-registry - 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. mvanvu/php-registry

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

mvanvu/php-registry
===================

Php Registry package

1.0.5(5y ago)114121MITPHPPHP &gt;=7.0

Since Nov 20Pushed 5y ago2 watchersCompare

[ Source](https://github.com/mvanvu/php-registry)[ Packagist](https://packagist.org/packages/mvanvu/php-registry)[ Docs](https://github.com/mvanvu/php-registry)[ RSS](/packages/mvanvu-php-registry/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (7)Used By (1)

Php array native registry
=========================

[](#php-array-native-registry)

Installation via Composer
-------------------------

[](#installation-via-composer)

```
{
	"require": {
		"mvanvu/php-registry": "~1.0"
	}
}
```

Alternatively, from the command line:

```
composer require mvanvu/php-registry
```

Usage
-----

[](#usage)

```
use MaiVu\Php\Registry;

$registry = new Registry;

// Set a value
$registry->set('foo', 'bar');

// Get a value
$value = $registry->get('foo');

// Set a deep value
$registry->set('foo.bar', 'deep');

// Get a deep value
$deep = $registry->get('foo.bar'); // Return 'deep' string
$foo  = $registry->get('foo'); // Return array ['bar' => 'deep']

// Check exists
$registry->has('foo');

// or
$registry->has('foo.bar');
```

With filter see more ()
-------------------------------------------------------------

[](#with-filter-see-more-httpsgithubcommvanvuphp-filter)

```
// Syntax
// Get and filter
$registry->get($var, $defaultValue, $filterType);

// Set and filter
$registry->set($var, $value, $filterType);

// Example

// Return 'john.doe@example.com'
$registry = new Registry(['email' => 'john(.doe)@exa//mple.com']);
$email = $registry->get('email', null, 'email');

// Set and filter
$registry->set('email', 'john(.doe)@exa//mple.com', 'email');

// Return 'john.doe@example.com'
echo $registry->get('email');
```

Initialise data
---------------

[](#initialise-data)

```
use MaiVu\Php\Registry;

$registry = new Registry($data);

$data is an array
$data = ['foo' => 'bar'];

or is an object
$data = new stdClass;

or is an instance of Registry
$data = new Registry;

or is a json string
$data = '{"foo": "bar"}';

or is php file that must return an array
$data = 'path/to/file/data.php';

or is json file
$data = 'path/to/file/data.json';
```

#### Merge another Registry

[](#merge-another-registry)

```
use MaiVu\Php\Registry;

// Merge an instance
$registry1 = new Registry(['foo' => 'bar']);
$registry2 = new Registry(['foo2' => 'bar2']);
$registry1->merge($registry2);

// Merge a mixed data
$registry1->merge(['foo2' => 'bar2']);
$registry1->merge(new stdClass);
$registry1->merge('{"foo": "bar"}');
$registry1->merge('path/to/file/data.php');
$registry1->merge('path/to/file/data.json');
```

#### Parse data to array

[](#parse-data-to-array)

```
use MaiVu\Php\Registry;
$arrayData = Registry::parseData('{"foo": "bar"}');

// Data is mixed type
$arrayData = Registry::parseData('path/to/file/data.php'); // Faster
$arrayData = Registry::parseData('path/to/file/data.json');
```

#### ArrayAccess (From 1.0.1)

[](#arrayaccess-from-101)

```
use MaiVu\Php\Registry;
$registry = new Registry(['foo' => 'bar']);
echo $registry['foo'] // => 'bar'

// The same
echo $registry->foo // => 'bar'

// Append data
$registry['foo.child'] = ['foo2' => 'bar2'];
$child = $registry['foo.child'];

// Result the same with new Registry(['foo2' => 'bar2']);
var_dump($child);

// result => 'bar2'
echo $registry->foo->child->foo2;
```

#### Dump data

[](#dump-data)

```
use MaiVu\Php\Registry;
$registry = new Registry(['foo' => 'bar']);

// To array
var_dump($registry->toArray());

// To json string
var_dump($registry->toString());
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~86 days

Recently: every ~102 days

Total

6

Last Release

1937d ago

PHP version history (2 changes)1.0PHP &gt;=5.4.0

1.0.3PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d12bfb47af4c0f877530c0019a08ca75588dbdaa0814205a3d1b1f0b3502dbef?d=identicon)[mvanvu](/maintainers/mvanvu)

---

Top Contributors

[![mvanvu](https://avatars.githubusercontent.com/u/5796168?v=4)](https://github.com/mvanvu "mvanvu (13 commits)")

---

Tags

phpregistry

### Embed Badge

![Health badge](/badges/mvanvu-php-registry/health.svg)

```
[![Health](https://phpackages.com/badges/mvanvu-php-registry/health.svg)](https://phpackages.com/packages/mvanvu-php-registry)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
