PHPackages                             phpcompatibility/phpcompatibility-paragonie - 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. phpcompatibility/phpcompatibility-paragonie

ActivePhpcodesniffer-standard[Utility &amp; Helpers](/categories/utility)

phpcompatibility/phpcompatibility-paragonie
===========================================

A set of rulesets for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.

1.3.4(9mo ago)1035.1M↓11.6%210LGPL-3.0-or-laterPHPCI passing

Since Oct 7Pushed 1w ago3 watchersCompare

[ Source](https://github.com/PHPCompatibility/PHPCompatibilityParagonie)[ Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)[ Docs](http://phpcompatibility.com/)[ GitHub Sponsors](https://github.com/PHPCompatibility)[ GitHub Sponsors](https://github.com/jrfnl)[ RSS](/packages/phpcompatibility-phpcompatibility-paragonie/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (10)

PHPCompatibilityParagonie
=========================

[](#phpcompatibilityparagonie)

[![Latest Stable Version](https://camo.githubusercontent.com/3e18e4047ffedef0fb5cca47a2d71d298d452717afb0e159d2345a1172fec8d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870636f6d7061746962696c6974792f706870636f6d7061746962696c6974792d70617261676f6e69653f6c6162656c3d737461626c65)](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)[![Latest Unstable Version](https://camo.githubusercontent.com/8b137137b1f1487b4efa2732711c5234b8c0fcf7d008e911bdbeae98a25fe43b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870636f6d7061746962696c6974792f706870636f6d7061746962696c6974792d70617261676f6e69653f696e636c7564655f70726572656c6561736573266c6162656c3d7072652d72656c65617365)](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)[![License](https://camo.githubusercontent.com/618d61774a9e4c450a16611652581f4cbc1cf250ffd1a288e7f6a808ac1a99fe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f504850436f6d7061746962696c6974792f504850436f6d7061746962696c69747950617261676f6e69653f636f6c6f723d303061376137)](https://github.com/PHPCompatibility/PHPCompatibilityParagonie/blob/master/LICENSE)[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityParagonie/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityParagonie/actions/workflows/ci.yml)

Using PHPCompatibilityParagonie, you can analyse the codebase of a project using either of the Paragonie polyfills, for PHP cross-version compatibility.

What's in this repo ?
---------------------

[](#whats-in-this-repo-)

Two rulesets for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.

These rulesets prevent false positives from the [PHPCompatibility standard](https://github.com/PHPCompatibility/PHPCompatibility) by excluding back-fills and polyfills which are provided by those libraries.

Paragonie Polyfill LibraryCorresponding PHPCompatibility RulesetIncludes[`random_compat`](https://github.com/paragonie/random_compat)`PHPCompatibilityParagonieRandomCompat`[`sodium_compat`](https://github.com/paragonie/sodium_compat)`PHPCompatibilityParagonieSodiumCompat``PHPCompatibilityParagonieRandomCompat`Note

As the `sodium_compat` library has `random_compat` [as a dependency](https://github.com/paragonie/sodium_compat/blob/master/composer.json), the `PHPCompatibilityParagonieSodiumCompat` ruleset includes the `PHPCompatibilityParagonieRandomCompat` ruleset.

In practice, this means that if your project uses both libraries, you just need to use the `PHPCompatibilityParagonieSodiumCompat` ruleset to prevent false positives from both.

Funding
-------

[](#funding)

**This project needs funding.**

The project team has spend thousands of hours creating and maintaining the PHPCompatibility packages. This is unsustainable without funding.

If you use PHPCompatibility, please fund this work by setting up a monthly contribution to the [PHP\_CodeSniffer Open Collective](https://opencollective.com/php_codesniffer).

Requirements
------------

[](#requirements)

- PHP &gt; 5.4
- [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) &gt;= 3.13.3. Use the latest stable release of PHP\_CodeSniffer for the best results.
- [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) 10.0.0+.

Installation instructions
-------------------------

[](#installation-instructions)

The only supported installation method is via [Composer](https://getcomposer.org/).

[Composer](https://getcomposer.org/) will automatically install the project dependencies and register the external rulesets with PHP\_CodeSniffer using the [Composer PHPCS plugin](https://github.com/PHPCSStandards/composer-installer/).

Run the following from the root of your project:

```
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer require --dev phpcompatibility/phpcompatibility-paragonie:"^2.0@dev"
```

Next, run:

```
vendor/bin/phpcs -i
```

If all went well, you will now see that the `PHPCompatibility`, `PHPCompatibilityParagonieRandomCompat` and `PHPCompatibilityParagonieSodiumCompat` standards are installed for PHP\_CodeSniffer.

Upgrade instructions
--------------------

[](#upgrade-instructions)

To upgrade this package, run the following command:

```
composer update --dev phpcompatibility/phpcompatibility-paragonie --with-dependencies
```

Tip

If you have a *root* requirement in your project for one of the packages used by this project, you may need to update with `--with-all-dependencies` instead.

How to use
----------

[](#how-to-use)

You can now use the following commands to inspect the code in your project for PHP cross-version compatibility:

```
vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieRandomCompat

vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieSodiumCompat
```

By default, you will only receive notifications about deprecated and/or removed PHP features.

To get the most out of the PHPCompatibilityParagonie rulesets, you should specify a `testVersion` to check against. That will enable the checks for both deprecated/removed PHP features as well as the detection of code using new PHP features.

For example:

```
# For a project which should be compatible with PHP 5.3 up to and including PHP 7.0:
vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieRandomCompat --runtime-set testVersion 5.3-7.0

# For a project which should be compatible with PHP 5.4 and higher:
vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieSodiumCompat --runtime-set testVersion 5.4-
```

For more detailed information about setting the `testVersion`, see the README of the generic [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions) standard.

### Testing PHP files only

[](#testing-php-files-only)

By default PHP\_CodeSniffer &lt; 4.0 will analyse PHP, JavaScript and CSS files. As the PHPCompatibility sniffs only target PHP code, you can make the run slightly faster by telling PHP\_CodeSniffer to only check PHP files, like so:

```
vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieRandomCompat --extensions=php --runtime-set testVersion 5.3-
```

License
-------

[](#license)

All code within the PHPCompatibility organisation is released under the GNU Lesser General Public License (LGPL). For more information, visit .

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance80

Actively maintained with recent releases

Popularity57

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 79.1% 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 ~260 days

Recently: every ~282 days

Total

11

Last Release

217d ago

Major Versions

1.3.4 → 2.0.0-alpha12025-10-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/c276f443673da81d365a16828d46818ea4e3136f7ce05491abcc70f43c82fa4c?d=identicon)[jrfnl](/maintainers/jrfnl)

![](https://www.gravatar.com/avatar/c1ef3caa2b7d98cb0f2d9bee0e50c47d9a4613ccbb7b8b618b070384e0585604?d=identicon)[wimg](/maintainers/wimg)

---

Top Contributors

[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (125 commits)")[![wimg](https://avatars.githubusercontent.com/u/313511?v=4)](https://github.com/wimg "wimg (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![fredden](https://avatars.githubusercontent.com/u/334786?v=4)](https://github.com/fredden "fredden (1 commits)")[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (1 commits)")

---

Tags

paragonie-polyfill-librariesphpphp-codesnifferphpcompatibilityphpcs-standardcompatibilitypolyfillstandardsphpcsstatic analysisparagonie

### Embed Badge

![Health badge](/badges/phpcompatibility-phpcompatibility-paragonie/health.svg)

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

###  Alternatives

[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

7.8k1.2B760](/packages/symfony-polyfill-mbstring)[symfony/polyfill-ctype

Symfony polyfill for ctype functions

4.0k1.0B192](/packages/symfony-polyfill-ctype)[symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

4.7k688.6M35](/packages/symfony-polyfill-php72)[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k823.1M147](/packages/symfony-polyfill-intl-idn)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k885.3M65](/packages/symfony-polyfill-intl-normalizer)[symfony/polyfill-php73

Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions

2.4k602.0M85](/packages/symfony-polyfill-php73)

PHPackages © 2026

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