PHPackages                             anlutro/phint - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. anlutro/phint

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

anlutro/phint
=============

23181[9 issues](https://github.com/anlutro/phint/issues)PHP

Since Oct 11Pushed 8y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Phint
=====

[](#phint)

[![Build Status](https://camo.githubusercontent.com/49f9c12e0f09e6409a35525ce976ae4c2e0767da674dea459fc4ae5d75cebef1/68747470733a2f2f7472617669732d63692e6f72672f616e6c7574726f2f7068696e742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/anlutro/phint)[![Latest Stable Version](https://camo.githubusercontent.com/d19071cb95a963e10f7ff23f0f2a7ad8fd5064bae6d75cdebf129c1d4ae920a0/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f7068696e742f762f737461626c652e737667)](https://github.com/anlutro/phint/releases)[![Latest Unstable Version](https://camo.githubusercontent.com/fb003174523216cfb8e56c253520c5455e10fdf9e5aa23744485548c11839df6/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f7068696e742f762f756e737461626c652e737667)](https://camo.githubusercontent.com/fb003174523216cfb8e56c253520c5455e10fdf9e5aa23744485548c11839df6/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f7068696e742f762f756e737461626c652e737667)[![License](https://camo.githubusercontent.com/93e23d5aac7da900ef22d517eea3d2c620d407b62f3a0c47a47a5b4504ffbb21/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f7068696e742f6c6963656e73652e737667)](https://camo.githubusercontent.com/93e23d5aac7da900ef22d517eea3d2c620d407b62f3a0c47a47a5b4504ffbb21/68747470733a2f2f706f7365722e707567782e6f72672f616e6c7574726f2f7068696e742f6c6963656e73652e737667)

Phint is a static code analysis tool for PHP. Very much a work in progress. Currently checks for:

- Undefined variables
- Properties/methods being called exist
- Classes being used in your code exist (instantiation, type-hinting, `instanceof`)
- Exception being caught actually exist and are exceptions (`catch (stdClass $e)` will error, for example)
- Functions being called actually exist
- Methods and functions are called with the correct number of arguments

More features to come. Check the Github issues.

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

[](#installation)

On a per-project basis:

```
composer require --dev anlutro/phint:dev-master@dev
./vendor/bin/phint /path/to/src

```

Globally:

```
wget https://files.lutro.me/phint.phar
chmod +x phint.phar
sudo mv phint.phar /usr/local/bin
phint /path/to/src

```

Usage
-----

[](#usage)

Note that you **must** be in your project's root for Phint to run. You also need a composer autoloader to be present in `vendor/autoload.php`.

Example output from a simple command run:

[![](https://camo.githubusercontent.com/73932a146f1af6772efc04dd2c3781a292feaa56a39c538d56f592797138f5b6/687474703a2f2f692e696d6775722e636f6d2f65746b6e3167322e706e67)](https://camo.githubusercontent.com/73932a146f1af6772efc04dd2c3781a292feaa56a39c538d56f592797138f5b6/687474703a2f2f692e696d6775722e636f6d2f65746b6e3167322e706e67)

You can pass `--strict` or `-s` as an arugment to get more errors. The errors marked as strict are more prone to be wrong, but should be more accurate as time goes on.

You can also pass `--debug` or `-d` to get some debug information. Currently this isn't much, unless you hit a fatal error, in which case you might get some more info.

By default, if you pass a directory or multiple file paths to the command, Phint will analyze all of them and spit out the errors as it goes along. If you pass `--exit-early` or `-e`, Phint will exit as soon as it finds a file with errors.

### Notes

[](#notes)

This tool makes some very heavy assumptions about how you're using it and your application.

Your project **must** have some sort of autoloader register script present in `vendor/autoload.php`. This autoloader **must** make every class and function in your project available.

The checker works best if all the files being checked are classes with methods, nothing more.

Contributing
------------

[](#contributing)

See the [CONTRIBUTING.md](CONTRIBUTING.md) file for information on contributing.

License
-------

[](#license)

The contents of this repository is released under the [GPL v3 license](http://opensource.org/licenses/GPL-3.0). See the [LICENSE](LICENSE) file included for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/48f62855097c02888b96494da9a389988cd7ecb9001465f8ec30f15672fb5b5a?d=identicon)[anlutro](/maintainers/anlutro)

---

Top Contributors

[![anlutro](https://avatars.githubusercontent.com/u/163093?v=4)](https://github.com/anlutro "anlutro (110 commits)")

### Embed Badge

![Health badge](/badges/anlutro-phint/health.svg)

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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