Fork me on GitHub
a Sensio Labs Product

I ate three cookies πŸͺ (v3.40.2) edition

Rule is_nullΒΆ

Replaces is_null($var) expression with null === $var.

WarningΒΆ

Using this rule is riskyΒΆ

Risky when the function is_null is overridden.

ExamplesΒΆ

Example #1ΒΆ

--- Original
+++ New
 <?php
-$a = is_null($b);
+$a = null === $b;

Rule setsΒΆ

The rule is part of the following rule sets:

Source classΒΆ

PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer