no_mixed_echo_print.rst 811 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ============================
  2. Rule ``no_mixed_echo_print``
  3. ============================
  4. Either language construct ``print`` or ``echo`` should be used.
  5. Configuration
  6. -------------
  7. ``use``
  8. ~~~~~~~
  9. The desired language construct.
  10. Allowed values: ``'echo'`` and ``'print'``
  11. Default value: ``'echo'``
  12. Examples
  13. --------
  14. Example #1
  15. ~~~~~~~~~~
  16. *Default* configuration.
  17. .. code-block:: diff
  18. --- Original
  19. +++ New
  20. -<?php print 'example';
  21. +<?php echo 'example';
  22. Example #2
  23. ~~~~~~~~~~
  24. With configuration: ``['use' => 'print']``.
  25. .. code-block:: diff
  26. --- Original
  27. +++ New
  28. -<?php echo('example');
  29. +<?php print('example');
  30. Rule sets
  31. ---------
  32. The rule is part of the following rule sets:
  33. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  34. - `@Symfony <./../../ruleSets/Symfony.rst>`_