PHPackages                             masnathan/object - 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. masnathan/object

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

masnathan/object
================

Super Object that can handle everything you throw at him... or almost everything.

v1.1.0(7y ago)593MITPHPPHP &gt;=5.3.0

Since Dec 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MASNathan/Object)[ Packagist](https://packagist.org/packages/masnathan/object)[ Docs](https://github.com/masnathan/object)[ RSS](/packages/masnathan-object/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Object
======

[](#object)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3b7091ceb3d9e0570f423e7cc928cb76cf6b1f6cff999e49610528086e59cc77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61736e617468616e2f6f626a6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masnathan/object)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a42017536f2bd9453a3a0cba8b0dc20f511149ac57cd8f53a605c28b0fde39c2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4d41534e617468616e2f4f626a6563742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/MASNathan/Object)[![Total Downloads](https://camo.githubusercontent.com/43e2f170eac49b7ae2a128baae5690ce15326167e4e7ab69623519ed13430fc3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61736e617468616e2f6f626a6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masnathan/object)

Super Object that can handle everything you throw at him...

Install
-------

[](#install)

Via Composer

```
$ composer require masnathan/object
```

Usage
-----

[](#usage)

```
use MASNathan\SuperObject;

$object = new SuperObject();
$object->setMode('live');
$object->set('mode', 'live');
$object->mode = 'live';
$object['mode'] = 'live';

echo $object->getAppMode() // 'live'
echo $object->get('app_mode') // 'live'
echo $object->app_mode // 'live'
echo $object['mode'] // 'live'
```

So... let's suppose you have an array like this:

```
$myBigDataArray = array(
	'details' => array(
		'first_name' => 'André',
		'last_name' => 'Filipe',
		'email' => 'andre.r.flip@gmail.com',
		'social' => array(
			'github' => 'https://github.com/MASNathan',
			'twitter' => 'https://twitter.com/masnathan'
		)
	),
	'account_info' => array(
		'admin' => true,
		'last_login' => 2015-06-13 13:37:00
	)
	'cart_items' => array(
		array('id' => 1337),
		// (...)
	)
);
```

Using the `SuperObject` class you can access it's information like this:

```
$object = new SuperObject($myBigDataArray);

echo $object->getDetails()->getFirstName(); // 'André'
$object->getDetails()->isLastName('Roque'); // false
echo $object->getDetails()->getSocial()->getGithub(); // 'https://github.com/MASNathan'
echo $object->getDetails()->getSocial()->getFacebook(); // ''
$object->getAccountInfo()->isAdmin(); // true
$object->getAccountInfo()->unsetLastLogin(); // unsets $myBigDataArray['account_info']['last_login']

foreach ($object->getCartItems() as $item) {
	echo $item->getId(); // 1337
}
```

You can also retrive the contents of the SuperObject as an `array` or a `StdClass`:

```
$object->toArray(); // array( ... )
$object->toObject(); // StdClass( ... )
```

And even serialize/ deserialize the object

```
unserialize(serialize($object));
// or as json
json_decode(json_encode($object));
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [André Filipe](https://github.com/masnathan)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~691 days

Total

3

Last Release

2613d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2139464?v=4)[André Filipe](/maintainers/MASNathan)[@MASNathan](https://github.com/MASNathan)

---

Top Contributors

[![MASNathan](https://avatars.githubusercontent.com/u/2139464?v=4)](https://github.com/MASNathan "MASNathan (23 commits)")

---

Tags

dataobjecthandler

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/masnathan-object/health.svg)

```
[![Health](https://phpackages.com/badges/masnathan-object/health.svg)](https://phpackages.com/packages/masnathan-object)
```

###  Alternatives

[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k849.8M169](/packages/myclabs-deep-copy)[fakerphp/faker

Faker is a PHP library that generates fake data for you.

3.9k358.5M3.5k](/packages/fakerphp-faker)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[dflydev/dot-access-data

Given a deep data structure, access data by dot notation.

718359.1M86](/packages/dflydev-dot-access-data)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)

PHPackages © 2026

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