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

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

vicary/object-path
==================

Fork of peridot-php/object-path. A string syntax to fetch values from array and object hierarchies

1.1.0(9y ago)013MITPHPPHP &gt;=5.4.0

Since Jul 24Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vicary/object-path)[ Packagist](https://packagist.org/packages/vicary/object-path)[ RSS](/packages/vicary-object-path/feed)WikiDiscussions master Synced 4w ago

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

ObjectPath [![Build Status](https://camo.githubusercontent.com/f535ccedd42e51118e63b223673fd0792332c21cdec622989024188304c595cf/68747470733a2f2f7472617669732d63692e6f72672f70657269646f742d7068702f6f626a6563742d706174682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/peridot-php/object-path)
===============================================================================================================================================================================================================================================================================================================

[](#objectpath-)

Allows traversal of objects and arrays with a simple string syntax. Extracted from Peridot's matcher library: [Leo](https://github.com/peridot-php/leo).

Usage
-----

[](#usage)

```
use Peridot\ObjectPath\ObjectPath;

// Works with nested arrays, objects, or a mixture of both.
$data = [
  'name' => 'Brian',
  'hobbies' => [
    'reading',
    'programming',
    'lion taming'
  ],
  'address' => new stdClass()
  [
    'street' => '1234 Lane',
    'zip' => '12345'
  ]
];

$data['address']->street = '1234 Lane';
$data['address']->zip = 12345;

// Wraps the value with ObjectPath
$path = new ObjectPath($data);

// Get the value directly
$reading = $path->{'hobbies[0]'};
$zip = $path->{'address[zip]'};

// Sets the value
$path->{'address->street'} = '12345 Street';

// Removes the property
unset($path->{'hobbies[2]'});

// backward compatible with peridot-php/object-path
$reading = $path->get('hobbies[0]');
$zip = $path->get('address[zip]');

// the result of get() is an ObjectPathValue instance
$value = $reading->getPropertyValue();
```

Tests
-----

[](#tests)

```
$ composer install
$ vendor/bin/peridot specs/

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3627d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/85772?v=4)[Vicary](/maintainers/vicary)[@vicary](https://github.com/vicary)

---

Top Contributors

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

---

Tags

arrayobjecttraversal

### Embed Badge

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

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

###  Alternatives

[symfony/property-access

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

2.8k317.3M3.1k](/packages/symfony-property-access)[cuyz/valinor

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

1.5k13.2M173](/packages/cuyz-valinor)[peridot-php/object-path

A string syntax to fetch values from array and object hierarchies

1054.9k1](/packages/peridot-php-object-path)[jasny/dotkey

Dot notation access for objects and arrays

15223.8k7](/packages/jasny-dotkey)[michaldudek/foundation

A set of useful PHP classes.

13112.6k13](/packages/michaldudek-foundation)

PHPackages © 2026

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