PHPackages                             fiv/tokenizer - 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. fiv/tokenizer

Abandoned → [funivan/php-tokenizer](/?search=funivan%2Fphp-tokenizer)ArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

fiv/tokenizer
=============

Extreme and flexible library for parsing and modify php code

0.9.8(11y ago)22541GPL v2PHPPHP &gt;=5.4

Since Dec 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/funivan/tokenizer)[ Packagist](https://packagist.org/packages/fiv/tokenizer)[ RSS](/packages/fiv-tokenizer/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (10)Used By (1)

Tokenizer
=========

[](#tokenizer)

[![Build Status](https://camo.githubusercontent.com/45582568ebccdc9e7f7f7a21b4e1e3aa9034aba05c82be1399331779e78a18c9/68747470733a2f2f7472617669732d63692e6f72672f66756e6976616e2f746f6b656e697a65722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/funivan/tokenizer)[![Coverage Status](https://camo.githubusercontent.com/c4d7b66e424c79182831b3f45873e7c458ce65cb0110266afd610e023764e9cf/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f66756e6976616e2f746f6b656e697a65722f62616467652e706e67)](https://coveralls.io/r/funivan/tokenizer)

Flexible library for parsing and modify php code;

\##Install: `composer require fiv/tokenizer:*`

\##Use For example lets find all if and elseif conditions:

```
  $fileTokens = new Fiv\Tokenizer\File(__FILE__);
  $query = $fileTokens->getCollection()->extendedQuery();
  $query->strict()->valueIs(array('if', 'elseif'));
  $query->section('(', ')');

  $blocks = $query->getBlock();
  foreach ($blocks as $code) {
    echo $code . "\n";
  }
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Recently: every ~45 days

Total

9

Last Release

4322d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ee14f8f97b3ead4c91823e410ea170293b55be64adf12a20d965f19008839a6?d=identicon)[funivan](/maintainers/funivan)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fiv-tokenizer/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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