Fork me on GitHub
a Sensio Labs Product

Brazilian Kangaroo (v3.17.0) edition

Rule no_unset_cast

Variables must be set null instead of using (unset) casting.

Examples

Example #1

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

Rule sets

The rule is part of the following rule sets:

@PHP80Migration

Using the @PHP80Migration rule set will enable the no_unset_cast rule.

@PHP81Migration

Using the @PHP81Migration rule set will enable the no_unset_cast rule.

@PHP82Migration

Using the @PHP82Migration rule set will enable the no_unset_cast rule.

@PhpCsFixer

Using the @PhpCsFixer rule set will enable the no_unset_cast rule.

@Symfony

Using the @Symfony rule set will enable the no_unset_cast rule.

The logo is © 2010-2022 Sensio Labs