Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

lines

> 编程语言
Open source

CLI tool for quick size measure of PHP project, used PHP features and more. Zero dependencies. Runs anywhere

352 stars0 likes0 views
WebsiteGitHub

About

CLI tool for quick size measure of PHP project, used PHP features and more. Zero dependencies. Runs anywhere

Lines of code and PHP Features

CLI tool for quick size measure of PHP project, and real used PHP features.

Zero dependencies. Runs anywhere.

What are killer features?

  • install anywhere - PHP 7.2? PHPUnit 6? Symfony 3? Not a problem, this package has zero dependencies and works on PHP 7.2+
  • get quick overview of your project size - no details, no complexity, just lines of code
  • get easy JSON output for further processing
  • measure used PHP features in your project - how much PHP 8.0-features used? How many attributes? How many arrow function? How many union types?

Install

The package is scoped and downgraded to PHP 7.2. So you can install it anywhere with any set of dependencies:

bash
composer require tomasvotruba/lines --dev

1. Measure Lines and Size

bash
vendor/bin/lines measure

By default, we measure the root directory. To narrow it down, provide explicit path:

bash
vendor/bin/lines measure src

For short output:

bash
vendor/bin/lines measure --short

For json output, just add --json:

bash
vendor/bin/lines measure --json

Also, you can combine them (very handy for blog posts and tweets):

bash
vendor/bin/lines measure --short --json

For the text output, you'll get data like these:

…

Or in a json format:

…

Longest files

Are you looking for top 10 longest files?

bash
vendor/bin/lines measure --longest
…

Scan package in /vendor

This tool measures your code, not the 3rd party libraries. It skips /vendor directory by default to avoid false positives. If you want to measure vendor files too, use --allow-vendor option:

bash
 vendor/bin/lines measure vendor/rector/rector --allow-vendor

2. PHP Feature Counter

Two codebases using PHP 8.4 in composer.json, are not the same codebases. One has zero type param/return/property declarations, other has promoted properties. Reveal their real value by counting PHP feature they actually use.

bash
vendor/bin/lines features src

For json output, just add --json:

bash
vendor/bin/lines features src --json

This command:

  • scans your codebase,
  • count PHP feature being used from which PHP version,
  • gives you quick overview of how modern the codebase really is

For the text output, you'll get data like these:

…

Or in a json format:

…

That's it. Happy coding!

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPastfeatureslines-of-codemeasure

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言