PHPackages                             henderjon/flags - 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. henderjon/flags

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

henderjon/flags
===============

a flag parser

v0.0.7(3d ago)013.1k↓29.7%BSD-3-ClausePHPPHP &gt;=8.1

Since May 14Pushed 1y ago2 watchersCompare

[ Source](https://github.com/henderjon/flags)[ Packagist](https://packagist.org/packages/henderjon/flags)[ Docs](http://github.com/henderjon/flags)[ Fund](https://www.buymeacoffee.com/henderjon)[ Fund](https://www.paypal.me/henderjon/10)[ RSS](/packages/henderjon-flags/feed)WikiDiscussions dev Synced yesterday

READMEChangelogDependencies (4)Versions (8)Used By (0)

flags
=====

[](#flags)

Flags takes an object, parses it's properties and methods and evaluates a given array (e.g. $argv) and populates the object with the given array.

Flags uses Attributes to parse/echo documentation.

For example usage, see the [example](example/example.php)

special cases
-------------

[](#special-cases)

- To set a bool true simply use it (e.g. `-var`). To set it's value it is required to use the equal sign (e.g. -var=false)
- `-help` or `--help` will always print DocStings
- when combing custom types, nullables, default values, and shadow methods, it can be tricky to make sure that everything that OUGHT to be nullable, is so
- errors/exception in the vein of `Argument #1 ($v) must be of type $TYPE, null given` that means that the expected type of the property, shadow function parameter, and shadow function return type don't match. Specifically, nullable types require everything else to be nullable, especially when it's a complex type that is nullable and defaults to null as a value.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance71

Regular maintenance activity

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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 ~129 days

Recently: every ~192 days

Total

7

Last Release

3d ago

PHP version history (2 changes)v0.0.1PHP &gt;=8.0

v0.0.2PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/15bb251b7550dc9a7ee1a7642fd6c4534f72797a17b3c913e9a15a4462979612?d=identicon)[henderjon](/maintainers/henderjon)

---

Top Contributors

[![henderjon](https://avatars.githubusercontent.com/u/114275?v=4)](https://github.com/henderjon "henderjon (39 commits)")[![donatj](https://avatars.githubusercontent.com/u/133747?v=4)](https://github.com/donatj "donatj (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/henderjon-flags/health.svg)

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M45](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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