no_unset_cast.rst 620 B

12345678910111213141516171819202122232425262728293031
  1. ======================
  2. Rule ``no_unset_cast``
  3. ======================
  4. Variables must be set ``null`` instead of using ``(unset)`` casting.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -$a = (unset) $b;
  14. +$a = null;
  15. Rule sets
  16. ---------
  17. The rule is part of the following rule sets:
  18. - `@PHP80Migration <./../../ruleSets/PHP80Migration.rst>`_
  19. - `@PHP81Migration <./../../ruleSets/PHP81Migration.rst>`_
  20. - `@PHP82Migration <./../../ruleSets/PHP82Migration.rst>`_
  21. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  22. - `@Symfony <./../../ruleSets/Symfony.rst>`_