PHPackages                             antalaron/circular-reference-detect - 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. antalaron/circular-reference-detect

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

antalaron/circular-reference-detect
===================================

Circular reference detector

v1.0.1(8y ago)370.8k↓25%MITPHPPHP &gt;=5.5.9

Since Apr 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/antalaron/circular-reference-detect)[ Packagist](https://packagist.org/packages/antalaron/circular-reference-detect)[ RSS](/packages/antalaron-circular-reference-detect/feed)WikiDiscussions master Synced 1mo ago

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

Circular reference detect
=========================

[](#circular-reference-detect)

[![Build Status](https://camo.githubusercontent.com/df462148708dc8858be5bef7e708d8fcbe5065eefc6912c45c6d4e1a6061e7a1/68747470733a2f2f7472617669732d63692e6f72672f616e74616c61726f6e2f63697263756c61722d7265666572656e63652d6465746563742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/antalaron/circular-reference-detect) [![Coverage Status](https://camo.githubusercontent.com/72ff9554087280b64c6913ce26580ee5d0ab7f7048fea8e22f1b8c9edc26e016/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616e74616c61726f6e2f63697263756c61722d7265666572656e63652d6465746563742f62616467652e737667)](https://coveralls.io/github/antalaron/circular-reference-detect?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/1234e8f02376e7fa75188a13689bee2c0eeeccc86efc474c2fc22e6a7b0cbd1b/68747470733a2f2f706f7365722e707567782e6f72672f616e74616c61726f6e2f63697263756c61722d7265666572656e63652d6465746563742f762f737461626c65)](https://packagist.org/packages/antalaron/circular-reference-detect) [![Latest Unstable Version](https://camo.githubusercontent.com/306930164f52d941a2019c594fff85ce09314ae6b32f4e4b355177b789f00629/68747470733a2f2f706f7365722e707567782e6f72672f616e74616c61726f6e2f63697263756c61722d7265666572656e63652d6465746563742f762f756e737461626c65)](https://packagist.org/packages/antalaron/circular-reference-detect) [![License](https://camo.githubusercontent.com/38f066b25d951d40497a61f13f086e36a052e69b8b8a75be69bd2c3cf139d6d5/68747470733a2f2f706f7365722e707567782e6f72672f616e74616c61726f6e2f63697263756c61722d7265666572656e63652d6465746563742f6c6963656e7365)](https://packagist.org/packages/antalaron/circular-reference-detect)

PHP library to detect reference circular references in array.

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

[](#installation)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:

```
$ composer require antalaron/circular-reference-detect
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Usage
-----

[](#usage)

Find a circular reference in an array:

```
require __DIR__.'/vendor/autoload.php';

use Antalaron\Component\CircularReferenceDetect\CircularReferenceDetect;
$a = [
    'a' => ['b'],
    'b' => ['c'],
    'c' => ['a'],
];
$detector = new CircularReferenceDetect();
$detector->hasCircularReference($a);
```

Documentation
-------------

[](#documentation)

1. [Installation](docs/01-installation.md)
2. [Usage](docs/02-usage.md)
3. [Contributing](docs/03-contributing.md)

License
-------

[](#license)

This library is under [MIT License](http://opensource.org/licenses/mit-license.php).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3228d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/464e80a7b766518129809bfb8ac8b22e8c51d274d66f2423d66520772413134c?d=identicon)[antalaron](/maintainers/antalaron)

---

Top Contributors

[![antalaron](https://avatars.githubusercontent.com/u/9386504?v=4)](https://github.com/antalaron "antalaron (9 commits)")

---

Tags

circular-referencelibraryphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/antalaron-circular-reference-detect/health.svg)

```
[![Health](https://phpackages.com/badges/antalaron-circular-reference-detect/health.svg)](https://phpackages.com/packages/antalaron-circular-reference-detect)
```

###  Alternatives

[verbb/patrol

Easy maintenance mode and smart HTTPS routing.

299.2k](/packages/verbb-patrol)

PHPackages © 2026

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