PHPackages                             drewlabs/php-value - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. drewlabs/php-value

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

drewlabs/php-value
==================

PHP object builder and serialization library

v0.3.23(1w ago)04042MITPHPPHP ^7.2|^8.0

Since May 24Pushed 1w ago1 watchersCompare

[ Source](https://github.com/azlabsphp/php-value)[ Packagist](https://packagist.org/packages/drewlabs/php-value)[ RSS](/packages/drewlabs-php-value/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (8)Versions (28)Used By (2)

```
# PHP Value

The library provides utility objects for PHP application and projects.

## Usage

The library offer two interface for creating an object.

Your can use OOP implementation you can extends the abstract [Drewlabs\PHPValue\Value] class:

- Object oriented implementation

```php
use Drewlabs\PHPValue\ObjectAdapter;

class ValueStub extends ObjectAdapter
{
    protected $__PROPERTIES__ = [
        'name',
        'address',
    ];
}

// Creating instance
$value = new ValueStub([
    'name' => 'Azandrew',
    'address' => '288 Avenue Pia, Lome'
]);
```

Or using the [Drewlabs\PHPValue\Functions\CreateValue] function.

- Functional interface

```php
// Imports
use function Drewlabs\PHPValue\Functions\CreateAdapter;

$value =  CreateAdapter(['name', 'address']);
```

Using both ways, you create an instance of [\Drewlabs\PHPValue\Value] class.

- Creating a copy of the object

```php
// Imports
use function Drewlabs\PHPValue\Functions\CreateAdapter;

$value =  CreateAdapter([ 'name', 'address' ]);

// This tries to create a deep copy of the object
$value1 = $value->copy(['name' => 'Sidoine Azandrew' ]);
```

- Getting property of the object

The value object is Array accessible meaning we can user [] operator to acces object properties. It also overrides magic [__get] method for properties accesibility and offers a [getAttribute()] method that query for a property on the object

```php
// Imports
use function Drewlabs\PHPValue\Functions\CreateAdapter;
$value =  CreateAdapter([
    'name',
    'address'
]);

$result = $value['name'];
$result = $value->name;
$result = $value->getAttribute('name');
```
```

###  Health Score

45

↑

FairBetter than 91% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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

Recently: every ~110 days

Total

26

Last Release

10d ago

PHP version history (2 changes)v0.2.0PHP ^7.2|^7.3|^7.4|^8.0|^8.1

v0.2.22PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/48c4973d500c7f4233d5ceacab51a57208d5fb60b0f95ae60264cf92380d0534?d=identicon)[azandrew-sidoine](/maintainers/azandrew-sidoine)

---

Top Contributors

[![azandrew-sidoine](https://avatars.githubusercontent.com/u/23530515?v=4)](https://github.com/azandrew-sidoine "azandrew-sidoine (60 commits)")

---

Tags

serializationcastbuilt type

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/drewlabs-php-value/health.svg)

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

###  Alternatives

[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k234.9M327](/packages/opis-closure)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k141.9M928](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k92.4M680](/packages/jms-serializer-bundle)[google/flatbuffers

FlatBuffers for PHP

26.1k148.3k5](/packages/google-flatbuffers)[apache/avro

Apache Avro™ is a data serialization system.

3.3k60.2k3](/packages/apache-avro)[flix-tech/avro-serde-php

A library to serialize and deserialize Avro records making use of the confluent schema registry

684.2M21](/packages/flix-tech-avro-serde-php)

PHPackages © 2026

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