PHPackages                             sempro/array-to-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. sempro/array-to-object

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

sempro/array-to-object
======================

Convert an array to an object

1.0.0(8y ago)2962MITPHP

Since Nov 3Pushed 8y ago3 watchersCompare

[ Source](https://github.com/s360digital/array-to-object)[ Packagist](https://packagist.org/packages/sempro/array-to-object)[ RSS](/packages/sempro-array-to-object/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Array to object
===============

[](#array-to-object)

[![Latest Version on Packagist](https://camo.githubusercontent.com/15ca9993f7a9907ce920b183868e49d137971fa99b3eb0c23387ed92064e4717/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656d70726f2f61727261792d746f2d6f626a6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sempro/array-to-object)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a9c8bc30ce0d4bda26749f86b3244d366d1441b863f4fa11ea310915e5ad817c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f53656d70726f2f61727261792d746f2d6f626a6563742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Sempro/array-to-object)[![Total Downloads](https://camo.githubusercontent.com/2cc0312d475d60b2f630ef9ae6a9804474436c0d6c8d6d3d0fdd2fc30dc9102d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656d70726f2f61727261792d746f2d6f626a6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sempro/array-to-object)

Gives you a global function that converts arrays to objects without removing object references. The object also implements Jsonable which will prettify the output if the object is returned (This only works in Laravel).

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

[](#installation)

1. `composer require sempro/array-to-object`

Usage
-----

[](#usage)

```
$data = [
    'id' => 1,
    'name' => 'Test',
];

$object = arrayToObject($data);

$object->name; // 'Test'
```

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3118d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35d9e549ce3a4c7fe0c64aa8664a21f8c97b7291c4ef62533ac578b44c5e3bae?d=identicon)[indentno](/maintainers/indentno)

---

Top Contributors

[![ventrec](https://avatars.githubusercontent.com/u/701788?v=4)](https://github.com/ventrec "ventrec (2 commits)")

---

Tags

arrayarray-to-objectlaravelobjectphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sempro-array-to-object/health.svg)

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

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)[mauricius/laravel-htmx

Laravel helper library for Htmx

364101.1k1](/packages/mauricius-laravel-htmx)[illuminate/reflection

The Illuminate Reflection package.

361.6M3](/packages/illuminate-reflection)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)

PHPackages © 2026

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