Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 987 Bytes

no_unset_cast.rst

File metadata and controls

39 lines (27 loc) · 987 Bytes

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.