antalaron / circular-reference-detect
Circular reference detector
Installs: 33 527
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
Requires (Dev)
- phpunit/phpunit: ^4.0|^5.0
This package is auto-updated.
Last update: 2024-11-16 19:54:34 UTC
README
PHP library to detect reference circular references in array.
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 of the Composer documentation.
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
License
This library is under MIT License.