PHPackages                             strictus/strictus - 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. strictus/strictus

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

strictus/strictus
=================

Strict Typing for local variables in PHP

v1.3.0(2y ago)1606.9k↓100%9MITPHPPHP ^8.1

Since Feb 5Pushed 1y ago4 watchersCompare

[ Source](https://github.com/php-strictus/strictus)[ Packagist](https://packagist.org/packages/strictus/strictus)[ Fund](https://www.paypal.me/wendelladriel)[ GitHub Sponsors](https://github.com/WendellAdriel)[ RSS](/packages/strictus-strictus/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

 [![Strictus](https://github.com/php-strictus/strictus/raw/main/art/logo.png)](https://github.com/php-strictus/strictus/raw/main/art/logo.png)Strictus
========

[](#strictus)

#### Strict Typing for local variables in PHP

[](#strict-typing-for-local-variables-in-php)

 [![Packagist](https://camo.githubusercontent.com/a1534b417d7cc8fdd804a28c77404041d5635d40ddd2259bbed90ad57af1387c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73747269637475732f73747269637475732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/strictus/strictus) [![PHP from Packagist](https://camo.githubusercontent.com/8e540a7e75f375019894613e8477e04ab43276f3ab401c7293456fda3adb6ff1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73747269637475732f73747269637475732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/strictus/strictus) [![GitHub Workflow Status (main)](https://camo.githubusercontent.com/19b80ddbec72cfcd0a40fa212d951c629fb57ab403cb552914b33de607207254/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d73747269637475732f73747269637475732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473) ](https://github.com/php-strictus/strictus/actions)

 [Introduction](#introduction) | [Installation](#installation) | [Usage](#usage) | [Credits](#credits) | [Contributing](#contributing)

Introduction
------------

[](#introduction)

Strictus brings **strict typing** for local variables into PHP.

With Strictus, you can control the types of local variables using different patterns.

---

`💣` **The problem:**

PHP has no support for strongly typed Local Variables.

Here is an illustrative example of a basic mistake:

```
