octal_notation.rst 948 B

123456789101112131415161718192021222324252627282930313233343536
  1. =======================
  2. Rule ``octal_notation``
  3. =======================
  4. Literal octal must be in ``0o`` notation.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. -<?php $foo = 0123;
  13. +<?php $foo = 0o123;
  14. Rule sets
  15. ---------
  16. The rule is part of the following rule sets:
  17. - `@PHP81Migration <./../../ruleSets/PHP81Migration.rst>`_
  18. - `@PHP82Migration <./../../ruleSets/PHP82Migration.rst>`_
  19. - `@PHP83Migration <./../../ruleSets/PHP83Migration.rst>`_
  20. - `@PHP84Migration <./../../ruleSets/PHP84Migration.rst>`_
  21. References
  22. ----------
  23. - Fixer class: `PhpCsFixer\\Fixer\\Basic\\OctalNotationFixer <./../../../src/Fixer/Basic/OctalNotationFixer.php>`_
  24. - Test class: `PhpCsFixer\\Tests\\Fixer\\Basic\\OctalNotationFixerTest <./../../../tests/Fixer/Basic/OctalNotationFixerTest.php>`_
  25. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.