-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Sniff basics | - |
---|---|
Fixable for PHP: | All |
Sniff type: | Modernize |
Fixer type: | Risky |
Short description
PHP 5.0 introduced an (unset)
type cast for feature completeness. This type cast has been deprecated as of PHP 7.2 and is slated to be removed in PHP 8.0.
Related PHPCompatibility sniff(s):
NewTypeCasts
DeprecatedTypeCasts
PHP manual references:
Example code:
Detect the following code pattern(s):
$a = (unset) $b;
$b = (unset) $b;
And fix these to:
$a = null;
unset( $b );
Notes for implementation of the sniff:
- Type casts only have effect when the result is assigned to something. Type casts are not done by reference!