PHPackages                             xtreed/php-token-stream - 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. xtreed/php-token-stream

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

xtreed/php-token-stream
=======================

Wrapper around PHP's tokenizer extension.

4.0.4(5y ago)03.6kBSD-3-ClausePHPPHP ^7.3 || ^8.0

Since Sep 23Pushed 5y agoCompare

[ Source](https://github.com/xtreed/php-token-stream)[ Packagist](https://packagist.org/packages/xtreed/php-token-stream)[ Docs](https://github.com/sebastianbergmann/php-token-stream/)[ GitHub Sponsors](https://github.com/sebastianbergmann)[ RSS](/packages/xtreed-php-token-stream/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (39)Used By (0)

phpunit/php-token-stream
========================

[](#phpunitphp-token-stream)

[![CI Status](https://github.com/sebastianbergmann/php-token-stream/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-token-stream/actions)[![Type Coverage](https://camo.githubusercontent.com/629ec76c83169e6ed9575a5e681c318627af31097193175b780af32ff394229f/68747470733a2f2f73686570686572642e6465762f6769746875622f73656261737469616e626572676d616e6e2f7068702d746f6b656e2d73747265616d2f636f7665726167652e737667)](https://shepherd.dev/github/sebastianbergmann/php-token-stream)

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

[](#installation)

You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):

```
composer require phpunit/php-token-stream

```

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

```
composer require --dev phpunit/php-token-stream

```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 88.5% 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 ~78 days

Recently: every ~20 days

Total

38

Last Release

2081d ago

Major Versions

1.4.11 → 2.0.02017-08-03

1.4.12 → 3.0.02018-02-01

3.1.1 → 4.0.02020-02-07

PHP version history (6 changes)1.1.4PHP &gt;=5.2.7

1.1.5PHP &gt;=5.3.3

2.0.0PHP ^7.0

3.0.0PHP ^7.1

4.0.0PHP ^7.3

4.0.3PHP ^7.3 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (324 commits)")[![edorian](https://avatars.githubusercontent.com/u/247397?v=4)](https://github.com/edorian "edorian (9 commits)")[![whatthejeff](https://avatars.githubusercontent.com/u/306525?v=4)](https://github.com/whatthejeff "whatthejeff (6 commits)")[![christeredvartsen](https://avatars.githubusercontent.com/u/25402?v=4)](https://github.com/christeredvartsen "christeredvartsen (6 commits)")[![orklah](https://avatars.githubusercontent.com/u/9605520?v=4)](https://github.com/orklah "orklah (2 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (2 commits)")[![ivyhjk](https://avatars.githubusercontent.com/u/12478859?v=4)](https://github.com/ivyhjk "ivyhjk (2 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (2 commits)")[![sun](https://avatars.githubusercontent.com/u/41992?v=4)](https://github.com/sun "sun (2 commits)")[![oker1](https://avatars.githubusercontent.com/u/431237?v=4)](https://github.com/oker1 "oker1 (1 commits)")[![loilo](https://avatars.githubusercontent.com/u/1922624?v=4)](https://github.com/loilo "loilo (1 commits)")[![rayrutjes](https://avatars.githubusercontent.com/u/5570853?v=4)](https://github.com/rayrutjes "rayrutjes (1 commits)")[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (1 commits)")[![slashmili](https://avatars.githubusercontent.com/u/585764?v=4)](https://github.com/slashmili "slashmili (1 commits)")[![StephenClouse](https://avatars.githubusercontent.com/u/468025?v=4)](https://github.com/StephenClouse "StephenClouse (1 commits)")[![xtreed](https://avatars.githubusercontent.com/u/3250116?v=4)](https://github.com/xtreed "xtreed (1 commits)")[![tamcap](https://avatars.githubusercontent.com/u/5289937?v=4)](https://github.com/tamcap "tamcap (1 commits)")[![tomzx](https://avatars.githubusercontent.com/u/188960?v=4)](https://github.com/tomzx "tomzx (1 commits)")[![fredemmott](https://avatars.githubusercontent.com/u/360927?v=4)](https://github.com/fredemmott "fredemmott (1 commits)")[![mazzcris](https://avatars.githubusercontent.com/u/6614577?v=4)](https://github.com/mazzcris "mazzcris (1 commits)")

---

Tags

tokenizer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xtreed-php-token-stream/health.svg)

```
[![Health](https://phpackages.com/badges/xtreed-php-token-stream/health.svg)](https://phpackages.com/packages/xtreed-php-token-stream)
```

###  Alternatives

[yethee/tiktoken

PHP version of tiktoken

1583.1M15](/packages/yethee-tiktoken)[gioni06/gpt3-tokenizer

PHP package for Byte Pair Encoding (BPE) used by GPT-3.

85537.5k8](/packages/gioni06-gpt3-tokenizer)[rajentrivedi/tokenizer-x

TokenizerX calculates required tokens for given prompt

91214.0k3](/packages/rajentrivedi-tokenizer-x)[nicoswd/php-rule-parser

Rule Engine - Rule Parser &amp; Evaluator

13078.6k7](/packages/nicoswd-php-rule-parser)[jeremeamia/functionparser

Function parser for PHP functions, methods, and closures

48169.7k6](/packages/jeremeamia-functionparser)[danny50610/bpe-tokeniser

PHP port for openai/tiktoken (most)

10422.0k1](/packages/danny50610-bpe-tokeniser)

PHPackages © 2026

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