strict_comparison.rst 507 B

1234567891011121314151617181920212223242526272829303132333435
  1. ==========================
  2. Rule ``strict_comparison``
  3. ==========================
  4. Comparisons should be strict.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Changing comparisons to strict might change code behavior.
  10. Examples
  11. --------
  12. Example #1
  13. ~~~~~~~~~~
  14. .. code-block:: diff
  15. --- Original
  16. +++ New
  17. <?php
  18. -$a = 1== $b;
  19. +$a = 1=== $b;
  20. Rule sets
  21. ---------
  22. The rule is part of the following rule set:
  23. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_