PHPackages                             phpstan/php-8-stubs - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpstan/php-8-stubs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phpstan/php-8-stubs
===================

PHP stubs extracted from php-src

0.4.34(5mo ago)315.5M↑11.9%11[4 issues](https://github.com/phpstan/php-8-stubs/issues)[3 PRs](https://github.com/phpstan/php-8-stubs/pulls)2MITPHPCI passing

Since Oct 5Pushed today6 watchersCompare

[ Source](https://github.com/phpstan/php-8-stubs)[ Packagist](https://packagist.org/packages/phpstan/php-8-stubs)[ RSS](/packages/phpstan-php-8-stubs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (215)Used By (2)

PHP 8 stubs
===========

[](#php-8-stubs)

PHP stub files automatically extracted from [php-src](https://github.com/php/php-src/). Used by [PHPStan](https://phpstan.org/) to understand signatures of built-in PHP classes and functions for PHP 8.0+.

Features
--------

[](#features)

- **Version-aware stubs** covering PHP 8.0 through 8.5, with `#[\Since('x.y')]` and `#[\Until('x.y')]` attributes to track when symbols and signatures were added or removed.
- **Comprehensive coverage**: core language stubs (`Zend/`), 69 extensions (`ext/`), and 6 SAPIs (`sapi/`).
- **Version-aware class/function map** (`Php8StubsMap`) that accepts a `$phpVersionId` and returns only the symbols available in that PHP version.
- **Fully automated extraction** via `extractor/extract.php` — stubs are never hand-written.
- **Daily CI updates** that extract from all PHP 8.x branches, auto-tag releases, and open PRs in `phpstan/phpstan-src`.

Usage
-----

[](#usage)

```
$map = new \PHPStan\Php8StubsMap($phpVersionId); // e.g. 80300 for PHP 8.3.0
$map->classes;   // array — lowercase class name => stub path
$map->functions; // array — lowercase function name => stub path
```

License
-------

[](#license)

Dual-licensed under [MIT](LICENSE) and [PHP-3.01](stubs/LICENSE).

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance84

Actively maintained with recent releases

Popularity57

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~18 days

Total

204

Last Release

168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/258cf2d2422f7e9ac5f7e1bb7a331f3fb717a11e51de7a3de2d6025507bd63cf?d=identicon)[ondrejmirtes](/maintainers/ondrejmirtes)

---

Top Contributors

[![phpstan-bot](https://avatars.githubusercontent.com/u/79867460?v=4)](https://github.com/phpstan-bot "phpstan-bot (176 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (116 commits)")[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (103 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (103 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (11 commits)")[![JanTvrdik](https://avatars.githubusercontent.com/u/175109?v=4)](https://github.com/JanTvrdik "JanTvrdik (3 commits)")[![VincentLanglet](https://avatars.githubusercontent.com/u/9052536?v=4)](https://github.com/VincentLanglet "VincentLanglet (2 commits)")[![DanielEScherzer](https://avatars.githubusercontent.com/u/179652704?v=4)](https://github.com/DanielEScherzer "DanielEScherzer (1 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (1 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (1 commits)")[![step-security-bot](https://avatars.githubusercontent.com/u/89328645?v=4)](https://github.com/step-security-bot "step-security-bot (1 commits)")

### Embed Badge

![Health badge](/badges/phpstan-php-8-stubs/health.svg)

```
[![Health](https://phpackages.com/badges/phpstan-php-8-stubs/health.svg)](https://phpackages.com/packages/phpstan-php-8-stubs)
```

###  Alternatives

[lvzhao1995/amap-sdk

高德地图SDK

1211.7k](/packages/lvzhao1995-amap-sdk)[moura137/laravel-elephantio

ElephantIO Service Provider for the Laravel PHP Framework

107.0k](/packages/moura137-laravel-elephantio)

PHPackages © 2026

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