PHPackages                             fran6co/phptrie - 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. [Search &amp; Filtering](/categories/search)
4. /
5. fran6co/phptrie

ActiveLibrary[Search &amp; Filtering](/categories/search)

fran6co/phptrie
===============

PHP Trie implementation

v1.1(12y ago)3515.8k↓19.2%10BSDPHPPHP &gt;=5.3.1

Since May 24Pushed 5y ago2 watchersCompare

[ Source](https://github.com/fran6co/phptrie)[ Packagist](https://packagist.org/packages/fran6co/phptrie)[ Docs](https://github.com/fran6co/phptrie)[ RSS](/packages/fran6co-phptrie/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

PHPTrie
=======

[](#phptrie)

A PHP implementation of a Trie, which is a data structure mainly used for fast string keys searches.

How to use PHPTrie
==================

[](#how-to-use-phptrie)

Creating a new PHPTrie structure
--------------------------------

[](#creating-a-new-phptrie-structure)

```

```

This creates an empty Trie.

Inserting elements
------------------

[](#inserting-elements)

You can add entries to the PHPTrie by specifying a key and a value.

```
$trie = new Trie();
$trie->add("key", 10);

```

or

```
$trie = new Trie();
$trie->add("This can be any string!", $myArray);

```

or

```
$trie = new Trie();
$trie->add("Make sure it's a string...", $stdClassObject);

```

Your values should probably have a consistent type throughout the whole trie, but exactly how you structure your values is up to you.

**From here on, we will assume that the PHPTrie object has been constructed and is called `$trie`.**

**Overwrite values**

By default the add method overwrites the values if already exists, if you want to avoid that you can use

```
$trie->add("blah", 11, false);

```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81% 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 ~313 days

Total

2

Last Release

4429d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/726088?v=4)[Francisco Facioni](/maintainers/fran6co)[@fran6co](https://github.com/fran6co)

---

Top Contributors

[![fran6co](https://avatars.githubusercontent.com/u/726088?v=4)](https://github.com/fran6co "fran6co (17 commits)")[![evictor](https://avatars.githubusercontent.com/u/1620156?v=4)](https://github.com/evictor "evictor (2 commits)")[![dkisselev](https://avatars.githubusercontent.com/u/945848?v=4)](https://github.com/dkisselev "dkisselev (1 commits)")[![Kostanos](https://avatars.githubusercontent.com/u/1136702?v=4)](https://github.com/Kostanos "Kostanos (1 commits)")

---

Tags

searchdata structuretrie

### Embed Badge

![Health badge](/badges/fran6co-phptrie/health.svg)

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

###  Alternatives

[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k178.3M943](/packages/elasticsearch-elasticsearch)[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[solarium/solarium

PHP Solr client

93432.7M98](/packages/solarium-solarium)[titasgailius/search-relations

A Laravel Nova tool.

3587.2M4](/packages/titasgailius-search-relations)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)[jsq/amazon-es-php

Support for using IAM authentication with the official Elasticsearch PHP client

9310.6M13](/packages/jsq-amazon-es-php)

PHPackages © 2026

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