PHPackages                             frvaillant/dichotomic - 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. frvaillant/dichotomic

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

frvaillant/dichotomic
=====================

This package aims to helps to easily implement the resolution of a dichotomous algorithm

v1.11(5y ago)07MITPHPPHP &gt;=7.0.0

Since Oct 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/frvaillant/dichotomic)[ Packagist](https://packagist.org/packages/frvaillant/dichotomic)[ RSS](/packages/frvaillant-dichotomic/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (5)Used By (0)

Dichotomic Algorithm resolver
=============================

[](#dichotomic-algorithm-resolver)

If you have to implement an algorithm that is a succession of questions which responses are true or false, you can use Algorithm resolver to help you to implement its resolution.

setup
-----

[](#setup)

`composer require frvaillant/dichotomic`

Create your algo Class
----------------------

[](#create-your-algo-class)

```
use Dichotomic\Resolver;

class BirdAlgo extends Resolver

{

}

```

Make the array representing your algorithm
------------------------------------------

[](#make-the-array-representing-your-algorithm)

This is a basic example used in order to determinate some bird species answering a few questions : Has this bird a hooked beak ? If yes is it nocturnal ? if yes has it some feather crests ? If no it is an owl.

```
use Dichotomic\Resolver;

class BirdAlgo extends Resolver

{
    private $result;

    protected $algo = [
        'hasHookedBeak' => [
            true  => [
                'isNocturnal' => [
                    true => [
                        'hasFeatherCrests' => [
                            true => 'ended:hibou',
                            false => 'ended:chouette'
                        ]
                    ],
                    false => [
                        'hasPointedWings' => [
                            true => 'ended:faucon',
                            false => 'ended:aigle'
                        ]
                    ]
                ]
            ],
            false => 'ended:null'
        ]
    ];
}
```

implement all methods you need in BirdAlgo class
------------------------------------------------

[](#implement-all-methods-you-need-in-birdalgo-class)

```
    /**
    * NOTE : all the methods listed as key in $algo array must be implemented below
     */
    protected function hasHookedBeak(): bool
    {
        return true;
    }

    protected function isNocturnal(): bool
    {
        return true;
    }

    protected function hasFeatherCrests(): bool
    {
        return false;
    }

    protected function hasPointedWings(): bool
    {
        return true;
    }

    protected function ended($result): void
    {
        $this->result = $result;
    }

    public function getResult()
    {
        return $this->result;
    }
```

Create index.php file
---------------------

[](#create-indexphp-file)

```
$algo = new BirdAlgo();
$algo->execute();
echo $algo->getResult();
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

3

Last Release

2024d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd84886e72173241d0e912ff66c60d5d2b0c154a66c1e908e3b124e4b61e641b?d=identicon)[frvaillant](/maintainers/frvaillant)

---

Top Contributors

[![frvaillant](https://avatars.githubusercontent.com/u/33039316?v=4)](https://github.com/frvaillant "frvaillant (22 commits)")

---

Tags

Algorithmresolutiondichotomous

### Embed Badge

![Health badge](/badges/frvaillant-dichotomic/health.svg)

```
[![Health](https://phpackages.com/badges/frvaillant-dichotomic/health.svg)](https://phpackages.com/packages/frvaillant-dichotomic)
```

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[donatello-za/rake-php-plus

Yet another PHP implementation of the Rapid Automatic Keyword Extraction algorithm (RAKE).

271865.1k10](/packages/donatello-za-rake-php-plus)[tga/simhash-php

SimHash similarities algorithm implementation for PHP 5.3

15243.5k1](/packages/tga-simhash-php)[fisharebest/algorithm

Implementation of standard algorithms in PHP.

7192.7k1](/packages/fisharebest-algorithm)[edgaras/strsim

Collection of string similarity and distance algorithms in PHP including Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and more

2423.0k](/packages/edgaras-strsim)[uestla/simplex-calculator

Simple tool for linear programming problems solving

427.6k](/packages/uestla-simplex-calculator)

PHPackages © 2026

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